Repository: quarkusio/quarkus
Issue: QuarkusDevModeTest freezes when it fails during the loading

**Describe the bug**
I just discovered a problem with Kogito Hot Reload test. When there is an error in an upper module, the test fails during the loading because of missing `-deplyoment` package but it freezes and then the build will reach the timeout and is aborted.
I did some analysis and created a PR to "workaround" it ([see link](https://github.com/kiegroup/kogito-runtimes/pull/526#issuecomment-632256309)) but I think it should solved also in Quarkus.

We have hot reload tests in a dedicated module instead of inside `-deployment` and we had no maven dependency on `deployment` module (because QuarkusDevModeTest loads the modules independently without using project configuration). The current fix is to declare the dependency so the module is skipped if deployment is not properly built.

I looked for a suggested configuration of hot reload tests from a different module but I was not able to find any so I guess my fix is correct (declare dependency on `deployment`) but still the build should not freeze in case of wrong configuration.

**Expected behavior**
Test fails and then build continue until the end

**Actual behavior**
Test fails during the initialization with [this stacktrace](https://gist.github.com/danielezonca/c3f9a53b37dd6e69aa01eb50e0a61eb4) but then freezes until build timeout (see last lines of the gist)

**To Reproduce**
See [here](https://github.com/kiegroup/kogito-runtimes/pull/526#issuecomment-632256309)

**Configuration**
```properties
# Add your application.properties here, if applicable.

```

**Screenshots**
(If applicable, add screenshots to help explain your problem.)

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`:
 Linux dzonca.mxp.csb 4.18.0-80.11.2.el8_0.x86_64 #1 SMP Sun Sep 15 11:24:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
 - Output of `java -version`: 
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
 - GraalVM version (if different from Java): 
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02, mixed mode, sharing)
 - Quarkus version or git rev: 
1.4.1.Final
 - Build tool (ie. output of `mvnw --version` or `gradlew --version`): 
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

**Additional context**
(Add any other context about the problem here.)


Changed files:
core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java
index 2fd84e4b64a..64912a75622 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java
@@ -158,6 +158,8 @@ public void close() throws IOException {
         if (realCloseable != null) {
             realCloseable.close();
         }
-        ApplicationStateNotification.waitForApplicationStop();
+        if (ApplicationStateNotification.getState() == ApplicationStateNotification.State.STARTED) {
+            ApplicationStateNotification.waitForApplicationStop();
+        }
     }
 }