Ensure host is in a running state before running tests further #1534
Conversation
Seems to fix remaining issues.
Better safe than
Avoids them being thrown in OneTimeTearDown.
@@ -91,12 +95,15 @@ void complete() | |||
}, e => | |||
{ | |||
complete(); | |||
throw new Exception("The test case threw an exception while running", e); | |||
exception = e; |
smoogipoo
Apr 23, 2018
Contributor
We may want to set exception before completing, otherwise there's a potential data race.
We may want to set exception before completing, otherwise there's a potential data race.
}); | ||
}); | ||
|
||
while (!completed && host?.ExecutionState != ExecutionState.Stopped) | ||
while (!completed && host.ExecutionState == ExecutionState.Running) |
smoogipoo
Apr 23, 2018
Contributor
Is this because Exit is explicitly called in the one time teardown? Specifically referring to this method potentially returning while the host is still running.
Is this because Exit is explicitly called in the one time teardown? Specifically referring to this method potentially returning while the host is still running.
peppy
Apr 23, 2018
Author
Member
I believe the case was when RunBlockingTest
was called before the TestCase
itself had reached BDL, causing host to be null here and exit before it even ran.
I believe the case was when RunBlockingTest
was called before the TestCase
itself had reached BDL, causing host to be null here and exit before it even ran.
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.
Seems to fix remaining issues.