-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Reset internal terminated flag in ToolTask (#8541) #8544
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -670,6 +670,7 @@ protected virtual int ExecuteTool( | |
| _standardOutputDataAvailable = new ManualResetEvent(false); | ||
|
|
||
| _toolExited = new ManualResetEvent(false); | ||
| _terminatedTool = false; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there any other things that need to be reset that currently aren't being reset? I'm wondering if we should move this to a separate "ResetToolTaskState" method.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've checked all related working variables (fields), I think all of them should be handled for now. |
||
| _toolTimeoutExpired = new ManualResetEvent(false); | ||
|
|
||
| _eventsDisposed = false; | ||
|
|
||
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.
In tests the ideal timeouts are infinitely large so they never hit or infinitely small (1ms) so they always hit or will only hit if the test discovers a bug. Is that possible?
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.
Per #8546, the timeout isn't properly used at the moment. We could consider delaying this PR until the other one is in?
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.
Hi @danmoseley, the test case will run sleep command to create some delay. It's possible to let the command sleep infinitely, it's controlled by XUnit inline parameters. However, if
Timeoutfailed when infinite delay is in use, the test will hang forever. So I set that to 10s, with a timeout of 1s, just to be safe. Yes, there's certain possibility that the timeout won't play out as planned. Just some tradeoff.Do you think I should set that delay in case 3 to a larger number (like 1 hour)?