Discuss TestContext cancellation
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1k
- Forks
- 312
- Avg merge
- 8h 30m
- Merged PRs (30d)
- 469
Description
Today, TestContext cancellation token (source) can be reused for multiple TestInitialize/TestCleanup calls (on inheritance hierarchy of a test class). This is even being extended in https://github.com/microsoft/testfx/pull/6132 to the new global init/cleanup.
If, during one call, we got cancelled already, what we do today is that we run the remaining steps with the same, already-cancelled token. What is the point of invoking something with an already-cancelled token? We should either:
- Create a new token for each call.
- Avoid executing subsequent initializes if we are already cancelled.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing TestContext cancellation through inherited TestInitialize and TestCleanup calls, including the global initialization and cleanup mentioned in PR 6132. Clarify whether cancellation should create a new token per call or skip subsequent calls, then add focused coverage for the chosen behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100