diff --git a/bin/testObservability/reporter/index.js b/bin/testObservability/reporter/index.js index e4a0fdfc..da44eaac 100644 --- a/bin/testObservability/reporter/index.js +++ b/bin/testObservability/reporter/index.js @@ -209,6 +209,7 @@ class MyReporter { } await this.uploadTestSteps(); + this.stopHttpServer(); }); } @@ -287,6 +288,20 @@ class MyReporter { debugOnConsole(`Exception in starting reporter server : ${error}`); debug(`Exception in starting reporter server : ${error}`, true, error); } + } + + stopHttpServer() { + if (this.httpServer) { + try { + this.httpServer.close(() => { + debugOnConsole('Reporter HTTP server closed'); + }); + this.httpServer = null; + } catch (error) { + debugOnConsole(`Exception in stopping reporter server : ${error}`); + debug(`Exception in stopping reporter server : ${error}`, true, error); + } + } } registerListeners() {