Repository navigation
Commit 8f63933
committed
test(config): probe the reset guard after the first delete rejects
The #2236 row on ContextProxy.spec.ts:1345 says the mid-settling storeSecret in my case happens
before the failing delete's rejection handler can run, so a regression that clears the guard after
that failure and still leaves a delete outstanding would pass this test as written. It measures
true. I built the regression the row names - every delete promise wrapped so its rejection handler
sets resetting = false and rethrows, a shape tsc accepts (exit 0 on that tree) - and measured the
pairing against 6516269, the commit this sits on:
case as shipped vs the regression shape 73 passed (73) - blind, the premise is right
case plus the tick vs the regression shape 1 failed | 72 passed (73) - catches it
case plus the tick vs the shipped proxy 73 passed (73) - not a false alarm about prod
case as shipped vs the shipped proxy 73 passed (73) - control
The change is a 0 ms tick between the timer that releases the pending delete and the storeSecret
probe, so the probe lands after the rejection handler has had its turn and while the apiKey delete
is still outstanding. The tick fires before the 20 ms one, so stragglerLanded still means what the
case says it means, and the assertion that was already there is the one that goes red.
The pairing is placement-sensitive and that belongs in the record. An earlier variant of the same
regression - .catch without the Promise.resolve hop, which tsc rejects because a Memento delete
returns a Thenable rather than a Promise - reddened the pre-existing case about not restoring a
pre-reset value while a rejected write settles instead of this one, so which case catches the class
depends on where the extra microtask hop lands. Anyone who moves this tick should re-measure the
pairing rather than assume it still holds.
The second half is what CI actually reddened. bseries ran the package's own gate on 6516269 and I
reproduced it here: pnpm --dir src run lint exits 1 with 5 problems, all in this file, at 29:19,
30:23, 31:19, 1263:12 and 1279:12, and no other file reports anything. My commit 96c9157 lowered
this file's no-explicit-any entry from 5 to 4 while the file still held five occurrences, and the
merge kept my side of that hunk. What that commit message claimed - that the entry was already stale
at 677e5e3 - was wrong: the prune run I quoted in the same session wrote 5 for the file, which is
what five occurrences looks like, and the green I quoted came from a per-file eslint invocation,
which does not reproduce what eslint . reports against eslint-suppressions.json. The gate that
matters is the package script, and I had not run it.
So two of the five are typed now: the two matcher predicates became (call: unknown[]), which is the
shape the neighbouring case in this same file already uses, and the entry records 3, which is what
eslint --prune-suppressions writes for this file and what the package gate agrees with. The three
let mockContext / mockGlobalState / mockSecrets doubles at 29, 30 and 31 stay as they are, and they
are the follow-up this row does not pay off: typing them needs either an explicit any inside a Mock
type argument, which buys nothing, or a typed double in src/test-utils/vscode.ts - makeExtension
Context takes Partial<ExtensionContext>, so a secrets double has to carry onDidChange, and the
helper already hides its one unavoidable cast behind as unknown as vscode.ExtensionContext at line
159. That is a shared test-util change, not a line of this row.
One run against the tree this commit makes: pnpm --dir src run lint exit 0 with the eslint cache
cleared first (the cache path lives in a junctioned node_modules), tsc --noEmit -p . exit 0, eslint
--prune-suppressions on this file exit 0 with its entry staying 3, prettier --check exit 0 on both
touched files, ContextProxy.spec.ts 73 passed (73), CustomModesManager.spec.ts 53 passed (53),
ClineProvider.spec.ts 389 passed (389) and core/config 324 passed (324). ContextProxy.ts is
untouched, blob 64023b9 before and after. No mutant count is quoted here: local Stryker cannot
start in this environment, so this commit quotes no digest it cannot produce.
git diff --cached --numstat for exactly what is staged here:
7 2 src/core/config/__tests__/ContextProxy.spec.ts
1 1 src/eslint-suppressions.json
Thread PRRT_kwDOSK-bwM606PC6 gets the E/F/G trio in a reply, and it is resolved because it is answered.1 parent 6516269 commit 8f63933
2 files changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
1263 | | - | |
| 1263 | + | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | 1266 | | |
| |||
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
1279 | | - | |
| 1279 | + | |
1280 | 1280 | | |
1281 | 1281 | | |
1282 | 1282 | | |
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1341 | 1346 | | |
1342 | 1347 | | |
1343 | 1348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| |||
0 commit comments