Skip to content

Commit

Permalink
Apply comment
Browse files Browse the repository at this point in the history
  • Loading branch information
YongGoose committed Jan 15, 2025
1 parent 6e679dc commit ca6f248
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.engine.TestEngine;
import org.junit.platform.engine.UniqueId;
import org.junit.vintage.engine.descriptor.RunnerScheduler;
import org.junit.runners.model.RunnerScheduler;
import org.junit.vintage.engine.descriptor.RunnerTestDescriptor;
import org.junit.vintage.engine.descriptor.VintageEngineDescriptor;
import org.junit.vintage.engine.discovery.VintageDiscoverer;
Expand Down Expand Up @@ -167,8 +167,9 @@ public void schedule(Runnable childStatement) {
@Override
public void finished() {
try {
executorService.shutdown();
executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
if (executorService.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
logger.warn(() -> "Executor service did not terminate within the specified timeout");
}
}
catch (InterruptedException e) {
logger.warn(e, () -> "Interruption while waiting for parallel test execution to finish");
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.junit.runner.manipulation.Filter;
import org.junit.runner.manipulation.Filterable;
import org.junit.runner.manipulation.NoTestsRemainException;
import org.junit.runners.ParentRunner;
import org.junit.runners.model.RunnerScheduler;

/**
* @since 4.12
Expand Down Expand Up @@ -171,8 +173,8 @@ public boolean isIgnored() {
return ignored;
}

public void setScheduler(org.junit.runners.model.RunnerScheduler scheduler) {
Runner runner = getRunnerToReport();
public void setScheduler(RunnerScheduler scheduler) {
Runner runner = getRunnerToReport();
if (runner instanceof ParentRunner) {
((ParentRunner<?>) runner).setScheduler(scheduler);
}
Expand Down

0 comments on commit ca6f248

Please sign in to comment.