Skip to content

Fix startup timeout after adjusting sleeps #5199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged

Conversation

andyleejordan
Copy link
Member

Glad I remembered this.

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

@Copilot Copilot AI left a comment

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 on lines +283 to +284
5 * this.sessionSettings.developer.waitForSessionFileTimeoutSeconds;
const warnAt = numOfTries - 5 * 30; // Warn at 30 seconds
Copy link
Preview

Copilot AI May 22, 2025

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.

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

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.

2 participants