Repository navigation
test: consolidate duplicate assertions and strengthen runtime checks - #33173
Conversation
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
10412481-0cf3-496b-b50a-f8b6d46facc3
Files selected for processing: 13-
config/scripts/windows-pty-table-stress-observer.test.mjsconfig/scripts/windows-security-reuse-benchmark.test.mjsmobile/src/transport/host-credential-cleanup.test.tsmobile/src/transport/host-edit-navigation.test.tsmobile/src/transport/host-endpoint-edit.test.tsmobile/src/transport/host-endpoint.test.tsmobile/src/transport/host-store-endpoint.test.tsmobile/src/transport/relay-host-reachability-latch.test.tsmobile/src/transport/relay-host-signed-out-supervisor.test.tsmobile/src/transport/relay-host-signed-out-verdict.test.tssrc/renderer/src/lib/browser-workspace-tab-activation.test.tssrc/renderer/src/lib/http-link-destinations.test.tssrc/renderer/src/lib/local-path-open-guard.test.ts
Files with no reviewable changes: 2-
- mobile/src/transport/host-endpoint.test.ts
- mobile/src/transport/host-endpoint-edit.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
| expect(phases).toContain('verify-prepared-node') | ||
| expect(phases).toContain('warm-compiler-before-measurement') |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
set -eu file='config/scripts/windows-security-reuse-benchmark.test.mjs' printf '%s\n' '--- matching phase references ---' rg -n -F -e 'phases' -e 'verify-prepared-node' -e 'warm-compiler-before-measurement' "$file" || test "$?" -eq 1 printf '%s\n' '--- surrounding test block ---' sed -n '300,390p' "$file" printf '%s\n' '--- changed-file diff against supplied merge base ---' git diff --unified=40 e30184fa8d383e9ae011e0fa0d3ea89df29f7cb2 2fa9fde5216bda93618a847c882e31e7aa3c3b4e -- "$file"
Repository: stablyai/orca
Length of output: 7856
Assert the relative phase order.
The existing index checks only require both phases to occur before control-full-build-and-probe. They do not require verify-prepared-node to occur before warm-compiler-before-measurement.
Suggested fix
-
--- "a/config/scripts/windows-security-reuse-benchmark.test.mjs" +++ "b/config/scripts/windows-security-reuse-benchmark.test.mjs" @@ -361,8 +361,10 @@ report.samples.every((sample) => sample.fullCommandMs >= sample.buildIncludingReuseProbesMs) ).toBe(true) const phases = report.phases.map((phase) => phase.label) - expect(phases).toContain('verify-prepared-node') - expect(phases).toContain('warm-compiler-before-measurement') + const verifyPreparedNode = phases.indexOf('verify-prepared-node') + const warmCompiler = phases.indexOf('warm-compiler-before-measurement') + expect(verifyPreparedNode).toBeGreaterThanOrEqual(0) + expect(warmCompiler).toBeGreaterThan(verifyPreparedNode) expect(phases.indexOf('verify-prepared-node')).toBeLessThan( phases.indexOf('control-full-build-and-probe') )
Committable suggestion
-
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.Suggested changeexpect(phases).toContain('verify-prepared-node') expect(phases).toContain('warm-compiler-before-measurement') const verifyPreparedNode = phases.indexOf('verify-prepared-node') const warmCompiler = phases.indexOf('warm-compiler-before-measurement') expect(verifyPreparedNode).toBeGreaterThanOrEqual(0) expect(warmCompiler).toBeGreaterThan(verifyPreparedNode)
Consolidates three duplicate endpoint and signed-out assertions into retained tests with the same inputs. Strengthens navigation targets, credential cleanup, relay callback counts and failure streaks, browser ownership and link delivery, and Windows probe digests and preparation ordering.
Reviewed 24 test sources; 203 declarations become 200 across 13 changed test files. Existing system-only link coverage is retained.
Validation: 276 baseline cases and 273 final cases pass with no skips; Node, CLI and renderer typechecks, the mobile test typecheck ratchet, changed-code quality, formatting and commit hooks pass. Isolated fault controls confirm repaired and retained assertions. Full CI will validate the committed head before merge.