From 645ae93d13b613e421b7f9bac336b4828fbe5d7e Mon Sep 17 00:00:00 2001 From: jinrongluo Date: Mon, 10 May 2021 23:22:50 -0400 Subject: [PATCH] [Issue #337] Fix Http Test Subscriber startup issue by moving the Thread.sleep into the child thread (#338) * [Issue #337] Fix HttpSubscriber startup issue * [Issue #337] test commit * [Issue #337] revert test commit Co-authored-by: j00441484 --- .../eventmesh/http/demo/sub/service/SubService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eventmesh-test/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java b/eventmesh-test/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java index e20fea98be..84432ca003 100644 --- a/eventmesh-test/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java +++ b/eventmesh-test/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java @@ -75,12 +75,15 @@ public void afterPropertiesSet() throws Exception { })); Thread stopThread = new Thread(() -> { + try { + Thread.sleep(5 * 60 * 1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } logger.info("stopThread start...."); System.exit(0); }); - Thread.sleep(5 * 60 * 1000); - -// stopThread.start(); + stopThread.start(); } }