Clean shared state pollution to avoid flaky tests.
This commit is contained in:
parent
f2e2140b57
commit
3a1d467f1d
|
@ -243,6 +243,11 @@ public class TaskMonitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized void purgeAllTasks() {
|
||||||
|
tasks.clear();
|
||||||
|
rpcTasks.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class encapsulates an object as well as a weak reference to a proxy
|
* This class encapsulates an object as well as a weak reference to a proxy
|
||||||
* that passes through calls to that object. In art form:
|
* that passes through calls to that object. In art form:
|
||||||
|
|
|
@ -142,6 +142,7 @@ public class TestTaskMonitor {
|
||||||
}
|
}
|
||||||
assertEquals("RPC Tasks have been purged!", RPCTaskNums, remainRPCTask);
|
assertEquals("RPC Tasks have been purged!", RPCTaskNums, remainRPCTask);
|
||||||
tm.shutdown();
|
tm.shutdown();
|
||||||
|
tm.purgeAllTasks();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue