From 3b20d40928af4bd3ca2e80aeec72cbd8f2facd5b Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Wed, 9 Jun 2021 21:00:34 +1000 Subject: [PATCH] Prevent potential deadlock Fixes #17793 --- .../deployment/dev/testing/TestSupport.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java index 7dd54e179f54d..84c5b9cca19d2 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java @@ -194,15 +194,17 @@ public TestRunResults getTestRunResults() { return testRunResults; } - public synchronized void pause() { - if (started) { - testRunner.pause(); + public void pause() { + TestRunner tr = this.testRunner; + if (tr != null) { + tr.pause(); } } - public synchronized void resume() { - if (started) { - testRunner.resume(); + public void resume() { + TestRunner tr = this.testRunner; + if (tr != null) { + tr.resume(); } }