test: refactored test suites to eliminate time-based sleeps and polling loops

- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
This commit is contained in:
can1357
2026-08-13 19:30:27 +02:00
parent 28997c0d46
commit b279db1790
263 changed files with 4603 additions and 6625 deletions
@@ -444,8 +444,11 @@ describe("getOrFetchView (TTL semantics)", () => {
expect(result.status).toBe("stale");
expect(result.rendered).toBe("old-diff");
await Promise.resolve();
await Bun.sleep(5);
for (let i = 0; i < 100; i++) {
const refreshed = getCached<{ refreshed: boolean }>(TEST_REPO, "pr-diff", 52, false);
if (refreshed?.payload.refreshed) break;
await Bun.sleep(0);
}
expect(fetchFresh).toHaveBeenCalledTimes(1);
const updated = getCached<{ refreshed: boolean }>(TEST_REPO, "pr-diff", 52, false);