test(scripts): dispatch a script of our own instead of hunting for someone else's - #2243
Merged
Merged
Conversation
…meone else's `Read a script's execution history and facets` has aborted on every nightly on record. My previous fix (#2220) moved it into the `post-mingo` phase on the theory that it simply ran too early. That was wrong, and the 2026-09-18 nightly proved it: the case ran in `post-mingo`, on a fresh tenant, after mingo had created and run scripts successfully at 02:26:17 and 02:29:22 — and aborted anyway. The real cause is that `scriptWithHistory()` needs a script that still exists AND has executions, and `MingoDeviceTest.@AfterEach` deletes every script it creates. No candidate ever survives the phase, so no amount of reordering helps. Both causes emit the same abort message, which is how the wrong one stuck. Stop depending on found state: create a script, dispatch it to an ONLINE Windows device, poll until the execution lands, then run the existing history and facet assertions against it. The class already owned and cleaned up a script for the schedule half; this adds a second and deletes it the same way. Needs a dispatch binding, which the library did not have — `ScriptApi.runScript` over the product's `runScript(input: RunScriptInput!): DispatchResponse!`. The unused `RunScriptRequest` DTO is left alone; it is a different, older shape. The move to `post-mingo` was not wasted: dispatching needs an enrolled ONLINE machine and one only exists after the device and assistant phases. The class javadoc and the tag comment both said the opposite of what is true and are corrected. Still skips, legitimately, when the tenant has no ONLINE Windows device — that is an environment precondition, not missing found state. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
🦩 Flamingo Code ReviewNo findings on the current head. Mode: advisory Need another pass? Commits pushed after this review are not reviewed automatically.
Prefer typing? Comment React 👍/👎 on inline comments to teach the reviewer. Started 2026-09-18 06:10 UTC · updated 2026-09-18 06:11 UTC · workflow run |
giokur
enabled auto-merge (squash)
September 18, 2026 06:56
mikhail-nosan
approved these changes
Sep 18, 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.
My previous fix for this was wrong
Read a script's execution history and facetshas aborted on every nightly on record. In #2220 Imoved it into the
post-mingophase on the theory that it simply ran before anything dispatched ascript.
The 2026-09-18 nightly disproved that cleanly. The case ran in
post-mingo, on a freshly registeredtenant, after mingo had created and run scripts successfully at 02:26:17 and 02:29:22 — and it
aborted anyway.
The actual cause
scriptWithHistory()walks the script list and wants one that still exists and has executions:MingoDeviceTest.@AfterEachdeletes every script it creates (scriptsToClean→deleteScript). Sothe scripts mingo dispatches are gone before the phase ends, and no candidate ever survives. Ordering
was never the problem, and no amount of reordering could have fixed it.
Both causes — "runs before its data exists" and "its data is cleaned up by whoever made it" — produce
the identical abort message. That is how the wrong reading stuck for two days.
The fix
Stop depending on found state. The case now creates a script, dispatches it to an ONLINE Windows
device, polls until the execution lands, and then runs the existing history and facet assertions
against its own script. The class already owned and cleaned up one script for the schedule half; this
adds a second and deletes it the same way.
That needed a dispatch binding the library did not have, so this also adds
ScriptApi.runScriptoverthe product's existing
runScript(input: RunScriptInput!): DispatchResponse!. The unusedRunScriptRequestDTO is left alone — different, older shape, nothing calls it.The move to post-mingo was still the enabling step
Dispatching needs an enrolled ONLINE machine, and one only exists after the device and assistant
phases. In
functionalthis fix would not be possible at all. The class javadoc and the tag commentboth asserted the old, wrong reason and are corrected to say this.
Still skips in one case, on purpose
If the tenant has no ONLINE Windows device the case still skips. That is an environment precondition
rather than missing found state, and asserting a page of zero rows against zero facets would pass
hollowly.
Module compiles.
🤖 Generated with Claude Code