mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-28 12:12:47 +00:00
test(server): wait for pending watchers before testing disposal (#8091)
Observation admission precedes asynchronous path resolution. Wait for subscriptions to start before disposal so the test consistently exercises late watcher cleanup. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -797,6 +797,8 @@ describe("WorkspaceGitServiceImpl", () => {
|
||||
|
||||
cwds.forEach((cwd) => service.registerWorkspace({ cwd }, vi.fn()));
|
||||
await vi.waitFor(() => {
|
||||
// Admission precedes async path resolution; disposal must race pending subscriptions.
|
||||
expect(subscribe).toHaveBeenCalledTimes(WORKSPACE_GIT_OBSERVATION_SETUP_CONCURRENCY);
|
||||
expect(service.getMetrics()).toMatchObject({
|
||||
workspaceRefreshAdmissionActiveCount: WORKSPACE_GIT_REFRESH_CONCURRENCY,
|
||||
workspaceRefreshAdmissionPendingCount: 1,
|
||||
|
||||
Reference in New Issue
Block a user