test: tighten gateway runtime assertions

This commit is contained in:
Peter Steinberger
2026-05-11 12:59:51 +01:00
parent 8d6bef0de1
commit e8dc492cb0
2 changed files with 12 additions and 16 deletions

View File

@@ -93,10 +93,8 @@ describe("gateway HTTP request trace scope", () => {
.split("\n")
.map((line) => JSON.parse(line) as Record<string, unknown>)
.find((record) => record.message === "handled request trace");
expect(traceRecord).toMatchObject({
traceId: activeTraceInHandler?.traceId,
spanId: activeTraceInHandler?.spanId,
});
expect(traceRecord?.traceId).toBe(activeTraceInHandler?.traceId);
expect(traceRecord?.spanId).toBe(activeTraceInHandler?.spanId);
} finally {
fs.rmSync(dir, { recursive: true, force: true });
}

View File

@@ -185,18 +185,16 @@ describe("server-runtime-services", () => {
expect(services.heartbeatRunner).toBe(hoisted.heartbeatRunner);
await vi.advanceTimersByTimeAsync(1_250);
await vi.dynamicImportSettled();
expect(hoisted.recoverPendingDeliveries).toHaveBeenCalledWith(
expect.objectContaining({
deliver: hoisted.deliverOutboundPayloads,
cfg: {},
}),
);
expect(hoisted.recoverPendingRestartContinuationDeliveries).toHaveBeenCalledWith(
expect.objectContaining({
deps: {},
maxEnqueuedAt: 123,
}),
);
expect(hoisted.recoverPendingDeliveries).toHaveBeenCalledWith({
deliver: hoisted.deliverOutboundPayloads,
cfg: {},
log: expect.any(Object),
});
expect(hoisted.recoverPendingRestartContinuationDeliveries).toHaveBeenCalledWith({
deps: {},
maxEnqueuedAt: 123,
log: expect.any(Object),
});
});
it("can defer cron startup while activating other scheduled services", async () => {