FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix startup timeout after adjusting sleeps by andyleejordan · Pull Request #5199 · PowerShell/vscode-powershell · GitHub

Fix startup timeout after adjusting sleeps - #5199

Merged
Andy Jordan (andyleejordan) merged 1 commit into
mainfrom
fix-startup-timeout
May 22, 2025
Merged

Andy Jordan (andyleejordan) merged 1 commit into
mainfrom
fix-startup-timeout

Conversation

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

[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.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM!

Andy Jordan (andyleejordan) enabled auto-merge (squash) May 22, 2025 20:17
Andy Jordan (andyleejordan) deleted the fix-startup-timeout branch May 22, 2025 20:21
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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL