Skip to content

Commit b1507dc

Browse files
committed
test(tailscale): poll for the probe group's exit after the timeout
1 parent 4effbd2 commit b1507dc

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎packages/tailscale/src/tailscale.test.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as FileSystem from "effect/FileSystem";
77
import * as Layer from "effect/Layer";
88
import * as Path from "effect/Path";
99
import * as PlatformError from "effect/PlatformError";
10+
import * as Schedule from "effect/Schedule";
1011
import * as Sink from "effect/Sink";
1112
import * as Stream from "effect/Stream";
1213
import * as TestClock from "effect/testing/TestClock";
@@ -471,7 +472,16 @@ describe.skipIf(HostProcess.Platform.defaultValue() === "win32")("tailscale prob
471472
const error = yield* Fiber.join(fiber);
472473

473474
assert.instanceOf(error, TailscaleCommandTimeoutError);
474-
assert.deepEqual(yield* Effect.forEach(pids, isProcessAlive), [false, false]);
475+
// SIGKILL lands asynchronously, so give the group a bounded real-time window to go.
476+
const alive = yield* Effect.forEach(pids, isProcessAlive).pipe(
477+
Effect.repeat({
478+
until: (states) => states.every((state) => !state),
479+
schedule: Schedule.spaced("20 millis"),
480+
times: 100,
481+
}),
482+
TestClock.withLive,
483+
);
484+
assert.deepEqual(alive, [false, false]);
475485
}).pipe(Effect.provide(NodeServices.layer)),
476486
);
477487
});

0 commit comments

Comments
 (0)