Timeout heavy Codex fix#321942
Draft
alexr00 wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
⚠️ Not ready to approve
The new overall timeout can be exceeded substantially (due to nested waitAndClick polling) and some retry paths don’t dismiss the dropdown, risking stale snapshots and flakiness.
Pull request overview
This PR updates the Agents Window smoke-test automation to make session type selection more resilient for slow/late-registering providers (notably the Codex variant) by retrying the full open → find → click → verify loop within a configurable timeout budget.
Changes:
- Extend
selectSessionTypeto accept an overalltimeoutMs(default 60s) and retry until the picker label commits. - Add verification polling after clicking a dropdown row to ensure the session type actually changed.
- Improve failure diagnostics by reporting the last seen picker label and dropdown rows on timeout.
File summaries
| File | Description |
|---|---|
| test/automation/src/agentsWindow.ts | Reworks selectSessionType retry/verify logic to better handle async-populated session provider dropdowns and slow provider initialization. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 4
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Comment on lines
+185
to
189
| if (!items?.some(el => rowText(el).includes(needle))) { | ||
| // Row never showed in this dropdown pass — close and retry. | ||
| await new Promise(r => setTimeout(r, 1000)); | ||
| continue; | ||
| } |
Comment on lines
+201
to
+204
| if (matchIndex < 0) { | ||
| await new Promise(r => setTimeout(r, 1000)); | ||
| continue; | ||
| } |
Comment on lines
174
to
+175
| await this.code.waitAndClick(SESSION_TYPE_PICKER_VISIBLE); | ||
| const deadline = Date.now() + 10_000; | ||
| while (Date.now() < deadline) { | ||
| const items = await this.code.getElements(itemSel, /* recursive */ true); | ||
| const openDeadline = Math.min(deadline, Date.now() + 10_000); |
| if (headerIndex >= 0) { | ||
| matchIndex = items.findIndex((el, index) => index > headerIndex && isActionRow(el)); | ||
| const dataIndex = items[matchIndex].attributes['data-index'] ?? String(matchIndex); | ||
| await this.code.waitAndClick(`.action-widget .monaco-list-row[data-index="${dataIndex}"]`); |
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.
No description provided.