-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GrpcCleanupRule errors out when retrying tests #8917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fix an issue in GrpcCleanupRule when tests are retried and the teardown() method is invoked multiple times, causing Stopwatch instance to throw an IllegalStateException. fixes grpc#8917.
I've never expected the same Rule instance can be re- Do you have any reference to "surefire/failsafe maven plugins are configured to retry failing tests"? Do the plugins work for all other Rules and they reuse the same rule instance when re-test? Are you using the rule as a static field of the test class, so that re-test failed? |
Yes, the rule is defined as a static field with the |
Fix an issue in GrpcCleanupRule when tests are retried and the teardown() method is invoked multiple times, causing Stopwatch instance to throw an IllegalStateException. fixes #8917.
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: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)
grpc-test-case.zip
The text was updated successfully, but these errors were encountered: