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() {
|
return new Statement() {
|
||||||
@Override
|
@Override
|
||||||
public void evaluate() throws Throwable {
|
public void evaluate() throws Throwable {
|
||||||
|
firstException = null;
|
||||||
try {
|
try {
|
||||||
base.evaluate();
|
base.evaluate();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|
@ -175,6 +176,7 @@ public final class GrpcCleanupRule implements TestRule {
|
||||||
* Releases all the registered resources.
|
* Releases all the registered resources.
|
||||||
*/
|
*/
|
||||||
private void teardown() {
|
private void teardown() {
|
||||||
|
stopwatch.reset();
|
||||||
stopwatch.start();
|
stopwatch.start();
|
||||||
|
|
||||||
if (firstException == null) {
|
if (firstException == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue