fix(test): stop counting unrelated requests in "stops posting" tests - #3770
Merged
Conversation
Both tests counted every request the page made, so unrelated periodic traffic (auth token refresh, notifications, cable reconnects) firing after the count snapshot failed them intermittently. Count only each tool's polling call (get_tlm_packet, get_all_interface_info) and assert polling actually happened before navigating away. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3770 +/- ##
==========================================
- Coverage 79.16% 79.13% -0.04%
==========================================
Files 894 894
Lines 66865 66865
Branches 2599 2599
==========================================
- Hits 52936 52912 -24
- Misses 13266 13292 +26
+ Partials 663 661 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The fixed 2 second sleep assumed the tool was already polling. On a loaded CI runner app boot can take longer than that, so the tests counted zero requests and failed the pre-navigation sanity check. Wait for the first polling request explicitly, which also subsumes the sanity check: if no poll ever arrives, waitForRequest times out rather than the test passing vacuously. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Navigating to another tool with page.goto is a full document load, so the JS context and any setInterval in it are destroyed by the browser. That made the "no more requests" assertion pass regardless of whether the tool cleared its own interval. Switch both tests to a client-side route change that unmounts the polling component while keeping the page alive: Packet Viewer switches packets via the chooser, CmdTlmServer switches to the Targets tab. Rename both to describe what they now verify. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
EmilyRagan
marked this pull request as ready for review
August 26, 2026 17:47
jmthomas
approved these changes
Aug 27, 2026
ryan-pratt
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
Both
stops posting to the api after closingtests counted every request the page made:The intent is to verify a tool tears down its polling interval when you navigate away. But because the listener is unfiltered, any unrelated periodic traffic that happens to fire in the 2 second window after the count snapshot fails the test — auth token refresh, notification polling, cable reconnects.
Seen in enterprise CI (run 32767849978, run 32073575025, etc), off by exactly one request:
Fix
Count only the polling call each tool actually makes:
packet-viewer.p.spec.ts—get_tlm_packet, from thesetIntervalinPacketViewer.vue. The test navigates toINST/ADCS, so it takes the regular-packet branch, not theLATEST/get_tlm_valuesone.cmd-tlm-server/file-menu.p.spec.ts—get_all_interface_info, fromInterfacesTab'supdate()driven by the sharedUpdater.jsmixin. That tab is the default child route.Matching is on the JSON-RPC body (
openc3Api.jsposts{ jsonrpc, method, ... }to/openc3-api/api), with the quotes included so"get_tlm_packet"can't prefix-matchget_tlm_values.Each test also now asserts
expect(requestCount).toBeGreaterThan(0)before navigating away. This is load-bearing: if the filter string were ever wrong the count would stay 0 and the test would pass vacuously, silently testing nothing.Verification
--repeat-each=3, both files — all pass. Prettier clean.🤖 Generated with Claude Code