-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
When GrpcCleanupRule
is used as a class rule and surefire/failsafe maven plugins are configured to retry failing tests, the rule throws an exception on the second run of the test with the following stacktrace:
java.lang.IllegalStateException: This stopwatch is already running.
at com.google.common.base.Preconditions.checkState(Preconditions.java:502)
at com.google.common.base.Stopwatch.start(Stopwatch.java:159)
at io.grpc.testing.GrpcCleanupRule.teardown(GrpcCleanupRule.java:150)
at io.grpc.testing.GrpcCleanupRule.access$100(GrpcCleanupRule.java:48)
at io.grpc.testing.GrpcCleanupRule$1.evaluate(GrpcCleanupRule.java:138)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.lang.Thread.run(Thread.java:829)
What version of gRPC-Java are you using?
1.44.0
What is your environment?
Linux/Java 8
What did you expect to see?
Expectation is for the rule not to throw when applied multiple times
What did you see instead?
An exception unrelated to the test is being thrown
Steps to reproduce the bug
Create a small maven project with a flakey test class, and enable surefire retry feature (see the attached project)
Metadata
Metadata
Assignees
Labels
No labels