Repository navigation
agentHost: wait for parsed plugin children instead of sleeping 50 ms - #348409
Draft
Bryan Chen (bryanchen-d) wants to merge 1 commit into
Draft
Bryan Chen (bryanchen-d) wants to merge 1 commit into
Bryan Chen (bryanchen-d) wants to merge 1 commit into
Conversation
The CopilotAgent setClientCustomizations test slept 50 ms for PluginController.sync to parse agent files from a real temp folder, then asserted. On a loaded Windows agent the parse took longer (main CI 497216). Wait for the SessionCustomizationUpdated action that carries the parsed children instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the test-only change replacing a fixed delay with an event-based wait.
No open issues 🎉
What changed in this PR
This test-only change removes a timing-dependent wait from the Agent Host customization test, addressing failures on slow or heavily loaded CI machines without changing production behavior.
Changes:
- Replace the fixed 50 ms delay with an event-based wait for
SessionCustomizationUpdatedcontaining parsed children. - Register the listener before setting customizations to avoid missing the update, while preserving existing assertions.
| File | Description |
|---|---|
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Wait for parsed plugin children to be published instead of relying on a fixed delay. |
Review effort: Balanced
This branch has not been deployed
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.
Main CI 497216 failed on Windows x64 Electron unit with one test:
Cause
After setting the active client's customizations, the test slept a fixed
setTimeout(50)"for the deferred resolution chain in PluginController.sync" and then asserted. That chain parsesagents/helper.mdfrom a real temp folder throughTestDiskFileSystemProvider, so on a slow or loaded agent the parsed update arrives after 50 ms and the assertion runs too early. The commit in range (#348151) doesn't touch the agent host.Change
Test-only. Wait for the
SessionCustomizationUpdatedaction that carries parsed children, using the sameEvent.toPromise(Event.filter(agent.onDidChatProgress, …))pattern as other tests in this file. The promise is created before the customizations are set, so the action can't be missed. Exactly one such update is published (checked with a temporary 1 s probe), so the assertions still see the same final state.Validation
main(all oncarry parsed children), 20/20 pass with this change.copilotAgent.test.tsrun gives the same pass/fail counts with and without the change. The local failures come from a missingvscode-sqlite3native build in my borrowed install.tsc --project src/tsconfig.json --noEmitreports no errors in this file.