perf(core): Optimize worker healthchecks (#11092)

This commit is contained in:
Iván Ovejero
2024-10-07 16:33:34 +02:00
committed by GitHub
parent 383b4765d2
commit 19fb728da0
5 changed files with 36 additions and 44 deletions

View File

@@ -50,10 +50,10 @@ describe('WorkerServer', () => {
globalConfig,
mock(),
mock(),
mock(),
externalHooks,
mock<InstanceSettings>({ instanceType: 'webhook' }),
prometheusMetricsService,
mock(),
),
).toThrowError(AssertionError);
});
@@ -75,10 +75,10 @@ describe('WorkerServer', () => {
globalConfig,
mock(),
mock(),
mock(),
externalHooks,
instanceSettings,
prometheusMetricsService,
mock(),
);
expect(procesExitSpy).toHaveBeenCalledWith(1);
@@ -102,10 +102,10 @@ describe('WorkerServer', () => {
globalConfig,
mock(),
mock(),
mock(),
externalHooks,
instanceSettings,
prometheusMetricsService,
mock(),
);
const CREDENTIALS_OVERWRITE_ENDPOINT = 'credentials/overwrites';
@@ -137,10 +137,10 @@ describe('WorkerServer', () => {
globalConfig,
mock(),
mock(),
mock(),
externalHooks,
instanceSettings,
prometheusMetricsService,
mock(),
);
await workerServer.init({ health: true, overwrites: false, metrics: true });
@@ -158,10 +158,10 @@ describe('WorkerServer', () => {
globalConfig,
mock(),
mock(),
mock(),
externalHooks,
instanceSettings,
prometheusMetricsService,
mock(),
);
await expect(
workerServer.init({ health: false, overwrites: false, metrics: false }),
@@ -176,10 +176,10 @@ describe('WorkerServer', () => {
globalConfig,
mock(),
mock(),
mock(),
externalHooks,
instanceSettings,
prometheusMetricsService,
mock(),
);
server.listen.mockImplementation((...args: unknown[]) => {