Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix startup timeout after adjusting sleeps#5199

Merged
andyleejordan merged 1 commit into
mainPowerShell/vscode-powershell:mainfrom
fix-startup-timeoutPowerShell/vscode-powershell:fix-startup-timeoutCopy head branch name to clipboard
May 22, 2025
Merged

Fix startup timeout after adjusting sleeps#5199
andyleejordan merged 1 commit into
mainPowerShell/vscode-powershell:mainfrom
fix-startup-timeoutPowerShell/vscode-powershell:fix-startup-timeoutCopy head branch name to clipboard

Conversation

@andyleejordan

Copy link
Copy Markdown
Member

Glad I remembered this.

Copilot AI review requested due to automatic review settings May 22, 2025 20:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adjust the session startup timeout logic to account for a reduced sleep interval of 200ms between polls, and remove the old static warning threshold.

  • Recompute numOfTries as timeoutSeconds * 5 to match 200ms sleeps
  • Update warnAt to subtract a 30-second equivalent in tries instead of using the removed static
  • Clarify sleep duration in comments
Comments suppressed due to low confidence (2)

src/process.ts:286

  • Update this comment to reflect the new polling interval (200ms) instead of 1 second.
// Check every second.

src/process.ts:282

  • Add or update unit tests to verify the new polling logic (200ms sleeps) and ensure warnAt is calculated correctly after this change.
const numOfTries = // We sleep for 1/5 of a second each try

Comment thread src/process.ts
Comment on lines +283 to +284
5 * this.sessionSettings.developer.waitForSessionFileTimeoutSeconds;
const warnAt = numOfTries - 5 * 30; // Warn at 30 seconds

Copilot AI May 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Replace magic numbers (5 and 30) with named constants (e.g., retriesPerSecond and warnThresholdSeconds) to clarify their purpose.

Suggested change
5 * this.sessionSettings.developer.waitForSessionFileTimeoutSeconds;
const warnAt = numOfTries - 5 * 30; // Warn at 30 seconds
PowerShellProcess.retriesPerSecond * this.sessionSettings.developer.waitForSessionFileTimeoutSeconds;
const warnAt = numOfTries - PowerShellProcess.retriesPerSecond * PowerShellProcess.warnThresholdSeconds; // Warn at 30 seconds

Copilot uses AI. Check for mistakes.

@SeeminglyScience SeeminglyScience left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andyleejordan andyleejordan enabled auto-merge (squash) May 22, 2025 20:17
@andyleejordan andyleejordan merged commit 774127c into main May 22, 2025
8 of 11 checks passed
@andyleejordan andyleejordan deleted the fix-startup-timeout branch May 22, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.