Skip to content

Commit 1f33504

Browse files
cushoncopybara-github
authored andcommitted
Turn down unused --experimental_persistent_test_runner experiment
PiperOrigin-RevId: 436225152
1 parent efb2b80 commit 1f33504

File tree

23 files changed

+31
-671
lines changed

23 files changed

+31
-671
lines changed

src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ java_library(
2222
":common_runner_java_files",
2323
],
2424
deps = [
25-
":persistent_test_runner",
2625
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal",
2726
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4",
2827
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/model",
@@ -33,19 +32,6 @@ java_library(
3332
],
3433
)
3534

36-
java_binary(
37-
name = "persistent_test_runner",
38-
srcs = [
39-
"PersistentTestRunner.java",
40-
"SuiteTestRunner.java",
41-
],
42-
deps = [
43-
"//src/main/protobuf:worker_protocol_java_proto",
44-
"//third_party:guava",
45-
"//third_party:jsr305",
46-
],
47-
)
48-
4935
java_binary(
5036
name = "Runner",
5137
main_class = "com.google.testing.junit.runner.BazelTestRunner",

src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,9 @@ public static void main(String[] args) {
7070
System.exit(2);
7171
}
7272

73-
if (PersistentTestRunner.isPersistentTestRunner()) {
74-
System.exit(
75-
PersistentTestRunner.runPersistentTestRunner(
76-
suiteClassName,
77-
System.getenv("WORKSPACE_PREFIX"),
78-
(suitClass, testArgs, classLoader, resolve) ->
79-
runTestsInSuite(suitClass, testArgs, classLoader, resolve)));
80-
}
81-
8273
int exitCode;
8374
try {
84-
exitCode =
85-
runTestsInSuite(suiteClassName, args, /* classLoader= */ null, /* resolve =*/ false);
75+
exitCode = runTestsInSuite(suiteClassName, args);
8676
} catch (Throwable e) {
8777
// An exception was thrown by the runner. Print the error to the output stream so it will be
8878
// logged
@@ -137,9 +127,8 @@ private static boolean checkTestSuiteProperty(String testSuiteProperty) {
137127
* Runs the tests in the specified suite. Looks for the suite class in the given classLoader, or
138128
* in the system classloader if none is specified.
139129
*/
140-
private static int runTestsInSuite(
141-
String suiteClassName, String[] args, ClassLoader classLoader, boolean resolve) {
142-
Class<?> suite = PersistentTestRunner.getTestClass(suiteClassName, classLoader, resolve);
130+
private static int runTestsInSuite(String suiteClassName, String[] args) {
131+
Class<?> suite = getTestClass(suiteClassName);
143132

144133
if (suite == null) {
145134
// No class found corresponding to the system property passed in from Bazel
@@ -159,6 +148,18 @@ private static int runTestsInSuite(
159148
return runner.run().wasSuccessful() ? 0 : 1;
160149
}
161150

151+
private static Class<?> getTestClass(String name) {
152+
if (name == null) {
153+
return null;
154+
}
155+
156+
try {
157+
return Class.forName(name);
158+
} catch (ClassNotFoundException e) {
159+
return null;
160+
}
161+
}
162+
162163
/**
163164
* Prints out stack traces if the JVM does not exit quickly. This can help detect shutdown hooks
164165
* that are preventing the JVM from exiting quickly.

src/java_tools/junitrunner/java/com/google/testing/junit/runner/PersistentTestRunner.java

Lines changed: 0 additions & 270 deletions
This file was deleted.

src/java_tools/junitrunner/java/com/google/testing/junit/runner/SuiteTestRunner.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)