Chore/test runner improvements (#12439)

**What**
Make sure there is no open handles left and that the shutdown function are properly called. Refactor and improve the medusa test runner. Make sure all modules instances are released and cleaned up

**NOTE:**
On a separate PR we can continue the investigation for the memory growing over time while the tests execute
This commit is contained in:
Adrien de Peretti authored and GitHub committed 2025-05-14 13:17:41 +00:00
1 parent e60d15ea84
commit ab22faaa52
13 files changed
+562 -292

No files matched your search

@@ -70,14 +70,6 @@ export class WorkflowsModuleService<
}
__hooks = {
onApplicationShutdown: async () => {
await this.workflowOrchestratorService_.onApplicationShutdown()
await this.redisDisconnectHandler_()
clearInterval(this.clearTimeout_)
},
onApplicationPrepareShutdown: async () => {
await this.workflowOrchestratorService_.onApplicationPrepareShutdown()
},
onApplicationStart: async () => {
await this.workflowOrchestratorService_.onApplicationStart()
@@ -88,6 +80,14 @@ export class WorkflowsModuleService<
} catch {}
}, 1000 * 60 * 60)
},
onApplicationPrepareShutdown: async () => {
await this.workflowOrchestratorService_.onApplicationPrepareShutdown()
},
onApplicationShutdown: async () => {
await this.workflowOrchestratorService_.onApplicationShutdown()
await this.redisDisconnectHandler_()
clearInterval(this.clearTimeout_)
},
}
static prepareFilters<T>(filters: T & { q?: string }) {