Repository navigation
Tests: poll pots commands without blocking the fake model - #131
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… test support children, nesting and mcp polled pots children with the synchronous gateway.pots. Each poll blocked the test process for a second or more, and the fake model in it could not answer meanwhile. They now use gateway.command, which runs the command as gateway.run does, and waitFor takes an async check. The four copies of isChild are one in test/support/fake-model.ts.
…files, not sleeps waitFor holds its time limit also while an async check runs, and the pots commands of a check that is cut off are killed before the wait ends. run() rejects when its process cannot start, and command() passes on the stderr of a command that worked, as pots() did. The two children tests that polled for a four-second sleep hold the child, and the main agent, on files in the workspace. nesting counts the child requests right after the stop.
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.
What was wrong. children, nesting and mcp polled
pots childreninwaitForwith the synchronousgateway.pots(execFileSync). A pots command takes 1-2 s on this host. Each poll blocked the test process for that time, and the fake model, which runs in the test process, could not answer meanwhile.What changed.
TestGateway.command(...): runs a pots command asgateway.rundoes (no block) and returns its output; throws when it fails, aspots()does.waitFortakes an async check.isChildwas copied in four test files; it is now intest/support/fake-model.ts(memory.test.ts uses it too).Left out, on purpose:
How it was tested.
npm run check. Each file alone withnpx vitest run test/<file>.test.ts, one at a time under a lock, before (on a copy of origin/main) and after. All pass. Vitest's Duration, in seconds; the host ran other test suites at the same time, so a few seconds either way is noise:Only children and nesting changed in a way that shows; the rest are unchanged files or noise. The full
npm testwas not run here.After the review (one Codex round). The count of child requests in nesting is taken right after the stop is confirmed; the two children tests that polled for a 4-second
sleephold the child (and the main agent) on workspace files instead;waitFor's time limit holds while an async check runs, and a cut-off check'spotsprocesses are killed and awaited;run()rejects on the process'serrorevent;command()passes on stderr of a command that worked. Times after it, each file alone (children ran while another suite ran on the host): children 224.0 s, nesting 167.1 s, mcp 73.8 s, memory 85.3 s, typing 105.5 s.