Repository navigation
fix(command-runtime): end a wait on its earlier captures when the last one answers late - #4814
Conversation
…t one answers late
Size Report
Startup median (7 runs, lower is better):
|
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This PR is ready at 476f5f6. The fix ends a wait on its earlier captures when the last one answers late, and the new injected-clock test covers that window. All checks pass on this commit, and there are no conflicts. Not verified here: the tests were not run locally or on a device. The regression was judged by reading the merge-base code against the test assertions. A live run cannot target this timing window, so the injected-clock test is the right proof. Not blocking, take or leave both:
The next step is maintainer review. |
Summary
Fixes a verdict change that #4794 introduced. Part of #4789.
Since #4794, a wait capture that answers after its cutoff is a timeout.
createWaitPollingreported that poll ascapture-truncated, so a wait whose earlier captures showed the target absent ended withwait_deadline_exceededinstead ofwait_target_absent. Under load the last capture often straddles the cutoff, so the reason changed with host speed. The Coverage job on #4813 failed this way inios-wait-selector.test.ts(expectedwait_target_absent, receivedwait_deadline_exceeded): https://github.com/callstack/agent-device/actions/runs/44745114108/job/136318310016Now a capture that answered late ends the poll with no deadline cause. Nothing was cut off mid-capture, so the wait ends on what its earlier captures established:
wait_target_absentafter a readable capture,wait_capture_stalledwhen no capture was readable in time. The late answer is still not counted as evidence. A capture that the deadline cancelled in flight keepscapture-truncated, as before. This matches the settle loop, which #4794 already treats this way.2 files changed. No wire declaration changed.
Validation
Head
476f5f6338.wait_target_absentwith one readable capture. It fails without the change.wait_capture_stalled.ios-wait-selector.test.tsandsettle-observation.test.ts: 8 of 9 local runs passed with host load about 27. One run failed a different case, "Apple wait selector captures like is when native queries fail". It did not recur in 6 more runs, and I have not found its cause.check:affectedrun: the host is under load from other validation runs. Hosted CI validates this head.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.