Skip to content

Feat: allow cooperative timeout#3314

Merged
Evangelink merged 8 commits intomicrosoft:mainfrom
Evangelink:cooperative-timeout
Jul 24, 2024
Merged

Feat: allow cooperative timeout#3314
Evangelink merged 8 commits intomicrosoft:mainfrom
Evangelink:cooperative-timeout

Conversation

@Evangelink
Copy link
Copy Markdown
Member

The current implementation of the timeout will create a "thread" that will observe the execution of the step (fixture or test method) for a given time (timeout value) and will stop observing after that. This means that we are producing dangling tasks where code continues to execute and possibly mutate state when we move to the next step which can have many unwanted consequences.

With this PR, we introduce a virtuous mode that ressemble what user has to do when implementing cooperative cancellation in their production code.

/!\ It's important to note that when opting-in to this mode, if the method (fixture or test) is ignoring the token then the method will continue.

Fixes #2432

@Evangelink Evangelink enabled auto-merge (squash) July 24, 2024 09:36
nohwnd
nohwnd previously approved these changes Jul 24, 2024
# Conflicts:
#	test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InitializeAndCleanupTimeoutTests.cs
#	test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs
#	test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs
@Evangelink Evangelink disabled auto-merge July 24, 2024 13:20
@Evangelink Evangelink merged commit 8c1c353 into microsoft:main Jul 24, 2024
@Evangelink Evangelink deleted the cooperative-timeout branch July 24, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeout features should allow for a cooperative only mode

3 participants