-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
ci: use output from nbgv instead of env variables #1564
Conversation
76d3889
to
5bd5bdb
Compare
…getting triggered before check gets a chance to complete
// Create the wait task and run the initial check | ||
// and subscribe to the OnAfterRender event. | ||
// This must happen before the timer is started, | ||
// as the check happens inside the renderers synchronization context, | ||
// and that may be blocked longer than the timeout on overloaded systems, | ||
// resulting in the timer completing before a single check has | ||
// has a chance to complete. | ||
WaitTask = CreateWaitTask(); | ||
timer = new Timer( | ||
static (state) => | ||
{ | ||
var @this = (WaitForHelper<T>)state!; | ||
@this.logger.LogWaiterTimedOut(@this.renderedFragment.ComponentId); | ||
@this.checkPassedCompletionSource.TrySetException( | ||
new WaitForFailedException( | ||
@this.TimeoutErrorMessage ?? string.Empty, | ||
@this.checkCount, | ||
@this.renderedFragment.RenderCount, | ||
@this.renderer.RenderCount, | ||
@this.capturedException)); | ||
}, | ||
this, | ||
GetRuntimeTimeout(timeout), | ||
Timeout.InfiniteTimeSpan); | ||
|
||
InitializeWaiting(); | ||
CheckAndInitializeWaiting(); | ||
|
||
// If the initial check did not complete successfully, | ||
// start the timer and recheck after every render until the timer expires. | ||
if (!WaitTask.IsCompleted) | ||
{ | ||
timer = new Timer( | ||
static (state) => | ||
{ | ||
var @this = (WaitForHelper<T>)state!; | ||
@this.logger.LogWaiterTimedOut(@this.renderedFragment.ComponentId); | ||
@this.checkPassedCompletionSource.TrySetException( | ||
new WaitForFailedException( | ||
@this.TimeoutErrorMessage ?? string.Empty, | ||
@this.checkCount, | ||
@this.renderedFragment.RenderCount, | ||
@this.renderer.RenderCount, | ||
@this.capturedException)); | ||
}, | ||
this, | ||
GetRuntimeTimeout(timeout), | ||
Timeout.InfiniteTimeSpan); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@linkdotnet it turns out this order is significant. After the change in the other PR I unskipped a few tests and one of the failed. Its check count was 0. This should ensure that we always perform at one check before the timer is started. It's needed because the checks happens inside the renderes sync context and that may be blocked so the first check never happens.
Pull request description
PR meta checklist
main
branch for codeor targeted at
stable
branch for documentation that is live on bunit.dev.Code PR specific checklist