Fix startup timeout after adjusting sleeps#5199
Merged
andyleejordan merged 1 commit intomainfrom May 22, 2025
Merged
Conversation
There was a problem hiding this comment.
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
numOfTriesastimeoutSeconds * 5to match 200ms sleeps - Update
warnAtto 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
warnAtis 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 |
There was a problem hiding this comment.
[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 |
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.
Glad I remembered this.