You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/08/12 07:30:36 UTC

[GitHub] [lucene-solr] dweiss opened a new pull request #1743: Gradual naming convention enforcement.

dweiss opened a new pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743


   LUCENE-8626. Here's how you can do it in a progressive, incremental way: make an exception list for existing suites not following the convention, but enforce it on anything new.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mikemccand commented on pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
mikemccand commented on pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#issuecomment-673726880


   Ugh sorry wrong PR!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mikemccand commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
mikemccand commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r469551162



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.
+      if (!exceptions.contains("!" + suiteName)) {
+        throw new AssertionError("Suite must follow Test*.java naming convention: "
+          + suiteName);
+      }
+    }
+  }
+
+  private void dumpSuiteNamesOnly(String suiteName) throws IOException {
+    // Has to be a global unique path (not a temp file because temp files
+    // are different for each JVM).
+    Path temporaryFile = Paths.get("c:\\_tmp\\test-naming-exceptions.txt");

Review comment:
       Hmm this is effectively a `// nocommit` right?  I.e. we must find the right place for this to live in the sources?

##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.
+      if (!exceptions.contains("!" + suiteName)) {
+        throw new AssertionError("Suite must follow Test*.java naming convention: "

Review comment:
       Hmm shouldn't it say `*Test.java naming convention`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mikemccand commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
mikemccand commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r470604022



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.
+      if (!exceptions.contains("!" + suiteName)) {
+        throw new AssertionError("Suite must follow Test*.java naming convention: "

Review comment:
       OK thanks @dweiss ;)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] s1monw commented on pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
s1monw commented on pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#issuecomment-674029698


   @mikemccand I opened https://github.com/apache/lucene-solr/pull/1751 for one of the failures and fixed the cloning issue in main line. I can't reproduce any of the other issues


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] cpoerschke commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
cpoerschke commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r483679806



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
##########
@@ -613,6 +613,7 @@ public static TestRuleIgnoreAfterMaxFailures replaceMaxFailureRule(TestRuleIgnor
     RuleChain r = RuleChain.outerRule(new TestRuleIgnoreTestSuites())
       .around(ignoreAfterMaxFailures)
       .around(suiteFailureMarker = new TestRuleMarkFailure())
+      .around(new VerifyTestClassNamingConvention())

Review comment:
       question: would this convention automatically and always apply to all classes derived from `LuceneTestCase` including any non-`org.apache` name spaces or would it be possible to opt-out (without an exclusion list) somehow for custom code that might perhaps have chosen a different convention?

##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.

Review comment:
       It's possible (though rare) that both `TestFooBar.java` and `FooBarTest.java` classes co-exist. I wonder if the `ALLOW_CONVENTION` and `test-naming-exceptions.txt` logic might be mutually exclusive i.e. when something is on the exclusion list then its opposite is not valid i.e. the excluded test may be renamed (and removed from the exclusion list) but until that is done the conventional naming is discouraged to avoid confusion between the two variants?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r483684317



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
##########
@@ -613,6 +613,7 @@ public static TestRuleIgnoreAfterMaxFailures replaceMaxFailureRule(TestRuleIgnor
     RuleChain r = RuleChain.outerRule(new TestRuleIgnoreTestSuites())
       .around(ignoreAfterMaxFailures)
       .around(suiteFailureMarker = new TestRuleMarkFailure())
+      .around(new VerifyTestClassNamingConvention())

Review comment:
       This is just code, anything can be changed... In the example I wrote it can't be turned off.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] cpoerschke commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
cpoerschke commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r516111173



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.

Review comment:
       Added a commit to the PR re: this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r483684981



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.

Review comment:
       Same here, really. It was just an example of how it can be solved, not a final solution.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r469724935



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.
+      if (!exceptions.contains("!" + suiteName)) {
+        throw new AssertionError("Suite must follow Test*.java naming convention: "

Review comment:
       Again - this was just to show how it can be done; I used prefix convention because it was mentioned on the list, that's it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#discussion_r469724710



##########
File path: lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.util;
+
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import org.junit.Assume;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Enforce test naming convention.
+ */
+public class VerifyTestClassNamingConvention extends AbstractBeforeAfterRule {
+  public static final Pattern ALLOWED_CONVENTION = Pattern.compile("(.+?)\\.Test[^.]+");
+
+  private static Set<String> exceptions;
+  static {
+    try {
+      exceptions = new HashSet<>();
+      try (BufferedReader is =
+             new BufferedReader(
+                 new InputStreamReader(
+                   VerifyTestClassNamingConvention.class.getResourceAsStream("test-naming-exceptions.txt"),
+                   StandardCharsets.UTF_8))) {
+        is.lines().forEach(exceptions::add);
+      }
+    } catch (IOException e) {
+      throw new UncheckedIOException(e);
+    }
+  }
+
+  @Override
+  protected void before() throws Exception {
+    if (TestRuleIgnoreTestSuites.isRunningNested()) {
+      // Ignore nested test suites that test the test framework itself.
+      return;
+    }
+
+    String suiteName = RandomizedContext.current().getTargetClass().getName();
+
+    // You can use this helper method to dump all suite names to a file.
+    // Run gradle with one worker so that it doesn't try to append to the same
+    // file from multiple processes:
+    //
+    // gradlew  test --max-workers 1 -Dtests.useSecurityManager=false
+    //
+    // dumpSuiteNamesOnly(suiteName);
+
+    if (!ALLOWED_CONVENTION.matcher(suiteName).matches()) {
+      // if this class exists on the exception list, leave it.
+      if (!exceptions.contains("!" + suiteName)) {
+        throw new AssertionError("Suite must follow Test*.java naming convention: "
+          + suiteName);
+      }
+    }
+  }
+
+  private void dumpSuiteNamesOnly(String suiteName) throws IOException {
+    // Has to be a global unique path (not a temp file because temp files
+    // are different for each JVM).
+    Path temporaryFile = Paths.get("c:\\_tmp\\test-naming-exceptions.txt");

Review comment:
       Mike, this patch was just to show how it can be done. And this method only collects test cases for exclusion - it's not used and could be removed since in theory we'd only want to take away from once-generated exceptions file. I left it to show how I collected the list in the first place.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mikemccand commented on pull request #1743: Gradual naming convention enforcement.

Posted by GitBox <gi...@apache.org>.
mikemccand commented on pull request #1743:
URL: https://github.com/apache/lucene-solr/pull/1743#issuecomment-673726633


   Another few, not sure if these also fail on mainline (though prolly we have seed shifting?):
   
   ```
   [junit4:pickseed] Seed property 'tests.seed' already defined: B87E3065EF9405AA
      [junit4] <JUnit4> says ᐊᐃ! Master seed: B87E3065EF9405AA
      [junit4] Executing 1 suite with 1 JVM.
      [junit4]
      [junit4] Started J0 PID(1341994@localhost).
      [junit4] Suite: org.apache.lucene.index.TestIndexWriterReader
      [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestIndexWriterReader -Dtests.method=testAddCloseOpen -Dtests.seed=B87E3065EF9405AA -Dtests.slow=true -Dtests.badapples=true -Dtests.locale=sg-CF -Dtests.timezone=Africa/Asmera -Dtests.ass\
   erts=true -Dtests.file.encoding=UTF-8
      [junit4] ERROR   0.86s | TestIndexWriterReader.testAddCloseOpen <<<
      [junit4]    > Throwable #1: org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed
      [junit4]    >        at __randomizedtesting.SeedInfo.seed([B87E3065EF9405AA:1C60E9EE76043EA5]:0)
      [junit4]    >        at org.apache.lucene.index.IndexReader.ensureOpen(IndexReader.java:257)
      [junit4]    >        at org.apache.lucene.index.IndexReader.incRef(IndexReader.java:184)
      [junit4]    >        at org.apache.lucene.index.IndexWriter.lambda$getReader$2(IndexWriter.java:653)
      [junit4]    >        at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:105)
      [junit4]    >        at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:642)
      [junit4]    >        at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:471)
      [junit4]    >        at org.apache.lucene.index.TestIndexWriterReader.testAddCloseOpen(TestIndexWriterReader.java:81)
      [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [junit4]    >        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [junit4]    >        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      [junit4]    >        at java.base/java.lang.Thread.run(Thread.java:834)
      [junit4]   2> NOTE: test params are: codec=Asserting(Lucene86): {field1=FST50, indexname=PostingsFormat(name=LuceneVarGapDocFreqInterval), id=PostingsFormat(name=LuceneVarGapDocFreqInterval), field3=PostingsFormat(name=LuceneVarGapDocFreqInterva\
   l), field2=PostingsFormat(name=Asserting), field5=FST50, field4=Lucene84}, docValues:{}, maxPointsInLeafNode=1841, maxMBSortInHeap=6.859086864809992, sim=Asserting(RandomSimilarity(queryNorm=false): {field1=DFR GL1, field3=IB LL-LZ(0.3), field2=DFR\
    I(F)L1, field5=LM Jelinek-Mercer(0.100000), field4=DFR GBZ(0.3)}), locale=sg-CF, timezone=Africa/Asmera
      [junit4]   2> NOTE: Linux 5.5.6-arch1-1 amd64/Oracle Corporation 11.0.6 (64-bit)/cpus=128,threads=1,free=243485936,total=536870912
      [junit4]   2> NOTE: All tests run in this JVM: [TestIndexWriterReader]
      [junit4] Completed [1/1 (1!)] in 1.06s, 1 test, 1 error <<< FAILURES!
      [junit4]
      [junit4]
      [junit4] Tests with failures [seed: B87E3065EF9405AA]:
      [junit4]   - org.apache.lucene.index.TestIndexWriterReader.testAddCloseOpen
      [junit4]
      [junit4]
      [junit4] JVM J0:     0.34 ..     1.95 =     1.61s
      [junit4] Execution time total: 1.95 sec.
      [junit4] Tests summary: 1 suite, 1 test, 1 error
   ```
   
   and this exciting one:
   
   ```
      [junit4] Executing 1 suite with 1 JVM.
      [junit4]
      [junit4] Started J0 PID(1359835@localhost).
      [junit4] Suite: org.apache.lucene.index.TestForTooMuchCloning
      [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestForTooMuchCloning -Dtests.method=test -Dtests.seed=B9D29D93C0F80019 -Dtests.slow=true -Dtests.badapples=true -Dtests.locale=fr-BJ -Dtests.timezone=Europe/London -Dtests.asserts=true -D\
   tests.file.encoding=UTF-8
      [junit4] FAILURE 0.33s | TestForTooMuchCloning.test <<<
      [junit4]    > Throwable #1: java.lang.AssertionError: too many calls to IndexInput.clone during merging: 567
      [junit4]    >        at __randomizedtesting.SeedInfo.seed([B9D29D93C0F80019:3186A2496E046DE1]:0)
      [junit4]    >        at org.apache.lucene.index.TestForTooMuchCloning.test(TestForTooMuchCloning.java:59)
      [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [junit4]    >        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [junit4]    >        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      [junit4]    >        at java.base/java.lang.Thread.run(Thread.java:834)
      [junit4]   2> NOTE: test params are: codec=Asserting(Lucene86): {field=PostingsFormat(name=Direct)}, docValues:{}, maxPointsInLeafNode=1191, maxMBSortInHeap=7.0033838103427355, sim=Asserting(RandomSimilarity(queryNorm=true): {field=DFR GLZ(0.3)}\
   ), locale=fr-BJ, timezone=Europe/London
      [junit4]   2> NOTE: Linux 5.5.6-arch1-1 amd64/Oracle Corporation 11.0.6 (64-bit)/cpus=128,threads=1,free=465865088,total=536870912
      [junit4]   2> NOTE: All tests run in this JVM: [TestForTooMuchCloning]
      [junit4] Completed [1/1 (1!)] in 0.53s, 1 test, 1 failure <<< FAILURES!
      [junit4]
      [junit4]
      [junit4] Tests with failures [seed: B9D29D93C0F80019]:
      [junit4]   - org.apache.lucene.index.TestForTooMuchCloning.test
      [junit4]
   ```
   
   This is an interesting failure, but does not repro on two tries:
   
   ```
   org.apache.lucene.codecs.asserting.TestAssertingDocValuesFormat > test suite's output saved to /l/simon/lucene/test-framework/build/test-results/test/outputs/OUTPUT-org.apache.lucene.codecs.asserting.TestAssertingDocValuesFormat.txt, copied below:
     1> [_0.cfe, _0.cfs, _0.si, segments_2]
      >     org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed
      >         at __randomizedtesting.SeedInfo.seed([D741FB190D5D9A11:DF431E8BE61D80F5]:0)
      >         at org.apache.lucene.index.IndexReader.ensureOpen(IndexReader.java:257)
      >         at org.apache.lucene.index.IndexReader.incRef(IndexReader.java:184)
      >         at org.apache.lucene.index.IndexWriter.lambda$getReader$2(IndexWriter.java:653)
      >         at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:105)
      >         at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:642)
      >         at org.apache.lucene.index.RandomIndexWriter.getReader(RandomIndexWriter.java:444)
      >         at org.apache.lucene.index.RandomIndexWriter.getReader(RandomIndexWriter.java:378)
      >         at org.apache.lucene.index.BaseDocValuesFormatTestCase.doTestBinaryVsStoredFields(BaseDocValuesFormatTestCase.java:1509)
      >         at org.apache.lucene.index.BaseDocValuesFormatTestCase.doTestBinaryVariableLengthVsStoredFields(BaseDocValuesFormatTestCase.java:1585)
      >         at org.apache.lucene.index.BaseDocValuesFormatTestCase.testBinaryVariableLengthVsStoredFields(BaseDocValuesFormatTestCase.java:1575)
      >         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      >         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      >         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      >         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1754)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:942)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:978)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:992)
      >         at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
      >         at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
      >         at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
      >         at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
      >         at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:370)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:819)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:470)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:951)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:836)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:887)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:898)
      >         at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
      >         at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
      >         at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
      >         at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
      >         at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
      >         at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:370)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:826)
      >         at java.base/java.lang.Thread.run(Thread.java:834)
     2> NOTE: reproduce with: ant test  -Dtestcase=TestAssertingDocValuesFormat -Dtests.method=testBinaryVariableLengthVsStoredFields -Dtests.seed=D741FB190D5D9A11 -Dtests.slow=true -Dtests.badapples=true -Dtests.locale=be -Dtests.timezone=America/Pho\
   enix -Dtests.asserts=true -Dtests.file.encoding=UTF-8
     2> NOTE: leaving temporary files on disk at: /l/simon/lucene/test-framework/build/tmp/tests-tmp/lucene.codecs.asserting.TestAssertingDocValuesFormat_D741FB190D5D9A11-001
     2> NOTE: test params are: codec=Asserting(Lucene86): {}, docValues:{}, maxPointsInLeafNode=1772, maxMBSortInHeap=5.360341248143611, sim=Asserting(RandomSimilarity(queryNorm=true): {fieldname=IB SPL-L3(800.0), docId=DFR I(n)L1, id=F1LOG}), locale=\
   be, timezone=America/Phoenix
     2> NOTE: Linux 5.5.6-arch1-1 amd64/Oracle Corporation 11.0.6 (64-bit)/cpus=128,threads=1,free=141772360,total=268435456
     2> NOTE: All tests run in this JVM: [TestAssertingDocValuesFormat]
   ```
   
   Also does not repro, but looks very exciting:
   
   ```
   org.apache.lucene.index.TestIndexWriterWithThreads > test suite's output saved to /l/simon/lucene/core/build/test-results/test/outputs/OUTPUT-org.apache.lucene.index.TestIndexWriterWithThreads.txt, copied below:
     2> Agu 14, 2020 1:17:34 AM com.carrotsearch.randomizedtesting.RandomizedRunner$QueueUncaughtExceptionsHandler uncaughtException
     2> WARNING: Uncaught exception in thread: Thread[Thread-10,5,TGRP-TestIndexWriterWithThreads]
     2> java.lang.RuntimeException: java.lang.AssertionError: There are still active DWPT in the pool: 1
     2>    at __randomizedtesting.SeedInfo.seed([311EB57ABEBC2CEB]:0)
     2>    at org.apache.lucene.index.TestIndexWriterWithThreads$2.run(TestIndexWriterWithThreads.java:622)
     2> Caused by: java.lang.AssertionError: There are still active DWPT in the pool: 1
     2>    at org.apache.lucene.index.DocumentsWriter.abort(DocumentsWriter.java:227)
     2>    at org.apache.lucene.index.IndexWriter.rollbackInternalNoCommit(IndexWriter.java:2354)
     2>    at org.apache.lucene.index.IndexWriter.rollbackInternal(IndexWriter.java:2324)
     2>    at org.apache.lucene.index.IndexWriter.rollback(IndexWriter.java:2317)
     2>    at org.apache.lucene.index.TestIndexWriterWithThreads$2.run(TestIndexWriterWithThreads.java:584)
     2>
      >     java.lang.AssertionError
      >         at org.junit.Assert.fail(Assert.java:86)
      >         at org.junit.Assert.assertTrue(Assert.java:41)
      >         at org.junit.Assert.assertTrue(Assert.java:52)
      >         at org.apache.lucene.index.TestIndexWriterWithThreads.testRollbackAndCommitWithThreads(TestIndexWriterWithThreads.java:634)
      >         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      >         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      >         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      >         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1754)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:942)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:978)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:992)
      >         at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
      >         at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
      >         at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
      >         at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
      >         at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:370)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:819)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:470)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:951)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:836)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:887)
      >         at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:898)
      >         at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
      >         at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
      >         at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
      >         at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
      >         at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
      >         at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
      >         at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:370)
      >         at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:826)
      >         at java.base/java.lang.Thread.run(Thread.java:834)
      >
      >     com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=46, name=Thread-10, state=RUNNABLE, group=TGRP-TestIndexWriterWithThreads]
      >
      >         Caused by:
      >         java.lang.RuntimeException: java.lang.AssertionError: There are still active DWPT in the pool: 1
      >             at __randomizedtesting.SeedInfo.seed([311EB57ABEBC2CEB]:0)
      >             at org.apache.lucene.index.TestIndexWriterWithThreads$2.run(TestIndexWriterWithThreads.java:622)
      >
      >             Caused by:
      >             java.lang.AssertionError: There are still active DWPT in the pool: 1
      >                 at org.apache.lucene.index.DocumentsWriter.abort(DocumentsWriter.java:227)
      >                 at org.apache.lucene.index.IndexWriter.rollbackInternalNoCommit(IndexWriter.java:2354)
      >                 at org.apache.lucene.index.IndexWriter.rollbackInternal(IndexWriter.java:2324)
      >                 at org.apache.lucene.index.IndexWriter.rollback(IndexWriter.java:2317)
      >                 at org.apache.lucene.index.TestIndexWriterWithThreads$2.run(TestIndexWriterWithThreads.java:584)
     2> NOTE: reproduce with: ant test  -Dtestcase=TestIndexWriterWithThreads -Dtests.method=testRollbackAndCommitWithThreads -Dtests.seed=311EB57ABEBC2CEB -Dtests.slow=true -Dtests.badapples=true -Dtests.locale=ha-GH -Dtests.timezone=Asia/Brunei -Dte\
   sts.asserts=true -Dtests.file.encoding=UTF-8
     2> NOTE: test params are: codec=Asserting(Lucene86): {date=BlockTreeOrds(blocksize=128), field=BlockTreeOrds(blocksize=128), docid=PostingsFormat(name=MockRandom), titleTokenized=FST50, id=PostingsFormat(name=MockRandom), body=BlockTreeOrds(block\
   size=128), title=TestBloomFilteredLucenePostings(BloomFilteringPostingsFormat(Lucene84))}, docValues:{docid_intDV=DocValuesFormat(name=Asserting), dv=DocValuesFormat(name=Lucene80), ___soft_deletes=DocValuesFormat(name=Lucene80), titleDV=DocValuesF\
   ormat(name=Lucene80)}, maxPointsInLeafNode=1053, maxMBSortInHeap=5.167595277851713, sim=Asserting(RandomSimilarity(queryNorm=true): {field=DFR GB2, titleTokenized=DFR I(ne)LZ(0.3), body=DFI(Saturated)}), locale=ha-GH, timezone=Asia/Brunei
     2> NOTE: Linux 5.5.6-arch1-1 amd64/Oracle Corporation 11.0.6 (64-bit)/cpus=128,threads=1,free=201567136,total=268435456
     2> NOTE: All tests run in this JVM: [TestPolygon2D, TestSoftDeletesDirectoryReaderWrapper, TestIndexWriterWithThreads]
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org