lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smiley <>
Subject Test passes, build fails with "Could not remove temporary path"
Date Fri, 20 Jan 2017 02:22:38 GMT
I wrote a test in Solr extending SolrTestCaseJ4 that sets up Solr a bit
differently than some tests.  Essentially instead of writing yet another
test schema.xml file, I decided to use some stock configs that are already
in a managed-schema mode that allow me to manipulate the schema via test
code -- but not persist it since I don't want/need that.  I could share the
code if it helps.  Any way, my test passes when run via IntelliJ; the test
JVM ends normally.

But when I run via "ant test-core -Dtestcase=mytestclassname" the test
itself passes but the build fails.  Right before the "5 slowest tests"
printout is the following curious message:

Could not remove temporary path:

I can't find the string "Could not remove temporary path" in our codebase;
maybe it's in randomized-testing?  (CC Dawid)  I'm not sure how to debug
this... maybe Solr wasn't closed properly?  Although this doesn't happen
when run via IntelliJ; maybe there's a race.

Here's my @BeforeClass:

private static void initManagedSchemaCore() throws Exception {
  // This testing approach means no new solrconfig or schema file or
per-test temp solr-home!
  System.setProperty("managed.schema.mutable", "true");
  System.setProperty("enable.update.log", "false");
  initCore("solrconfig-managed-schema.xml", "ignoredSchemaName?");

  IndexSchema oldSchema = h.getCore().getLatestSchema();

  HeatmapSpatialField fieldType = new HeatmapSpatialField();
  Map<String, String> ftInitMap = new HashMap<>();
  ftInitMap.put("prefixTree", "packedQuad");
  ftInitMap.put("square", "true");
  ftInitMap.put("minDistErr", "1000");
  ftInitMap.put("maxDistErr", "50");
  ftInitMap.put("distanceUnits", "kilometers");
  fieldType.init(oldSchema, ftInitMap);
  SchemaField schemaField = new SchemaField(HM_FLD, fieldType,
SchemaField.STORED | SchemaField.INDEXED, null);
  boolean persist = false; // don't write to test resource dir
  IndexSchema newSchema = oldSchema.addField(schemaField, persist);


  strategy = fieldType.getStrategy(schemaField.getName());
  ctx = strategy.getSpatialContext();

Or maybe most of that info is a red herring and the problem is something
else.  Any way, it'd be nice if someone else who ran into this problem
before could share some advice.

Thanks in advance,
~ David
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: | Book:

View raw message