Skip to content
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

Ensure host is in a running state before running tests further #1534

Merged
merged 7 commits into from Apr 23, 2018

Conversation

@peppy
Copy link
Member

@peppy peppy commented Apr 21, 2018

Seems to fix remaining issues.

Seems to fix remaining issues.
@peppy peppy force-pushed the peppy:fix-runaway-threads-2 branch to 4d9350c Apr 21, 2018
peppy added 2 commits Apr 21, 2018
Better safe than
@peppy peppy force-pushed the peppy:fix-runaway-threads-2 branch to 0f59882 Apr 21, 2018
peppy added 2 commits Apr 21, 2018
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;

This comment has been minimized.

@smoogipoo

smoogipoo Apr 23, 2018
Contributor

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)

This comment has been minimized.

@smoogipoo

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.

This comment has been minimized.

@peppy

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.

@peppy peppy merged commit 87baad0 into ppy:master Apr 23, 2018
1 check passed
1 check passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@peppy peppy deleted the peppy:fix-runaway-threads-2 branch Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants