mirror of https://github.com/grpc/grpc-java.git
testing: fix GrpcCleanupRule issue when retrying tests (#8918)
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.
This commit is contained in:
parent
df6db6fe8b
commit
bfb970ce03
|
|
@ -149,6 +149,7 @@ public final class GrpcCleanupRule implements TestRule {
|
|||
return new Statement() {
|
||||
@Override
|
||||
public void evaluate() throws Throwable {
|
||||
firstException = null;
|
||||
try {
|
||||
base.evaluate();
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -175,6 +176,7 @@ public final class GrpcCleanupRule implements TestRule {
|
|||
* Releases all the registered resources.
|
||||
*/
|
||||
private void teardown() {
|
||||
stopwatch.reset();
|
||||
stopwatch.start();
|
||||
|
||||
if (firstException == null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue