Skip to content

Commit 246fff5

Browse files
committed
test(driver-turso): name the bound in the latch assertion's failure message
A red from a sampled counter reads `expected 0 to be greater than 0`, which names no duration -- and merge-queue triage classifies a red by asking exactly that, so the flake this file produced was read as a behaviour regression. Both latch assertions now carry a message naming the bound they missed, so the red says in words that a duration went unmet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XTBcV7zZHmokdyQgXjbyEU
1 parent 7b5f6b7 commit 246fff5

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

packages/drivers/driver-turso/src/turso-driver-timeout.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
* remote the transport reaches" is, off the timed path, and that is the
3939
* anti-vacuity guard the case actually needs.
4040
*
41+
* Both latch assertions carry a failure message naming their bound, so a red
42+
* says in words that a DURATION went unmet. Merge-queue triage classifies a red
43+
* by asking whether the assertion names a duration; a bare `expected 0 to be
44+
* greater than 0` from a sampled counter answers no and is read as a behaviour
45+
* regression, which is exactly how this file's flake was first read.
46+
*
4147
* Each arm carries a NEGATIVE control — the same stalled remote with no
4248
* `timeout` (and, on the replica arm, `timeout: 0`, the documented "no bound")
4349
* is still pending well past the window — so the failure the positive case
@@ -154,7 +160,10 @@ describe('TursoDriverConfig.timeout — remote mode over HTTP', () => {
154160
cleanups.push(() => reachable.disconnect());
155161
// Settles only when the fixture tears the socket down; nobody reads that.
156162
reachable.find('probe', {}).catch(() => {});
157-
expect(await settlesWithin(remote.firstRequest, REACH_BOUND_MS)).toBe(true);
163+
expect(
164+
await settlesWithin(remote.firstRequest, REACH_BOUND_MS),
165+
`the HTTP transport did not reach the stalled fixture within ${REACH_BOUND_MS} ms`,
166+
).toBe(true);
158167

159168
const driver = new TursoDriver({ url: remote.url, timeout: WINDOW_MS });
160169
expect(driver.transportMode).toBe('remote');
@@ -188,7 +197,10 @@ describe('TursoDriverConfig.timeout — remote mode over HTTP', () => {
188197
expect(await stillPendingAfter(operation, CONTROL_WAIT_MS)).toBe(PENDING);
189198
// Same latch, same reason: nothing bounds this operation, so the request is
190199
// reached and the condition is awaited, never sampled at a chosen instant.
191-
expect(await settlesWithin(remote.firstRequest, REACH_BOUND_MS)).toBe(true);
200+
expect(
201+
await settlesWithin(remote.firstRequest, REACH_BOUND_MS),
202+
`the HTTP transport did not reach the stalled fixture within ${REACH_BOUND_MS} ms`,
203+
).toBe(true);
192204
});
193205
});
194206

0 commit comments

Comments
 (0)