Keep reference to leaked scope to make sure GC detection doesn't kick in first. (#2972)
This commit is contained in:
parent
9997dee68e
commit
62cfc060d3
|
|
@ -141,7 +141,8 @@ class StrictContextStorageTest {
|
||||||
|
|
||||||
@SuppressWarnings("ReturnValueIgnored")
|
@SuppressWarnings("ReturnValueIgnored")
|
||||||
void decorator_close_withLeakedScope(Supplier<Scope> method, String methodName) throws Exception {
|
void decorator_close_withLeakedScope(Supplier<Scope> method, String methodName) throws Exception {
|
||||||
Thread thread = new Thread(method::get);
|
AtomicReference<Scope> scope = new AtomicReference<>();
|
||||||
|
Thread thread = new Thread(() -> scope.set(method.get()));
|
||||||
thread.setName("t1");
|
thread.setName("t1");
|
||||||
thread.start();
|
thread.start();
|
||||||
thread.join();
|
thread.join();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue