-
Notifications
You must be signed in to change notification settings - Fork 46
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
Optimize creation of test-thread context using test framework independent resource pooling #144
Conversation
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.
I'm not fully finished with my review, but sharing my comments so far.
The idea (of breaking the 1-1 relationship between test runner and test thread container) first sounded strange, but the more I think on it the better I like it. Basically that means that you can anytime "borrow" a test runner (that will have an own worker thread (test-thread)) and use it until needed, but then return. As the runner interface also implies (with start and finish methods), a single test runner cannot be used to run parallel tests, but you can acquire multiple test runners if you want. That sounds good.
My comments:
- We should keep backwards compatibility in regards of the
ITestRunner
interface, because that is commonly used by plugins and I would like to delay releasing a v3. So we should keep the existing methods and properties on that interface and remove them only with the next major release. - Regardless of the backwards compatibility, I would keep the
TestWorkerId
property for diagnostic reasons and make the code in a way that assigns some human-readable ID. (I would also keep it in the trace messages.) This is really useful if you need to understand parallel issues. I have used that several times. (Whether the id is passed to the runner from the runner manager or it is stored in the container does not matter, both would be fine.) - As far as I understood the code (correct me if I'm wrong), we only keep a registry of the available test worker (test-thread) containers, but not the ones that have been given out for execution. That means if a code borrowed a test runner but never returned (some error), than the container will never be disposed. I'm not sure if it is bad, but we should be aware of this. Maybe we should keep a registry for all test workers to know at least that some of them was not properly returned (and show it in a diag message). What do you think?
And one more comment:
|
I think it's a good idea. I was also thinking about asserting/writing a warning in |
027fad0
to
79c7224
Compare
Regarding the logging of active |
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.
Made a few smaller comments and raised the question of "when to release the test thread context". See below.
…stWorkerId test framework independently
@obligaron Side note: For me it is better if you do not apply rebase or force push after an initial review has been done, because this way I have to make a full review again and I cannot just see the "diff". Merging the main to the PR branch is fine - we will squash it anyway. |
…stry to TestRunnerManagerStaticApiTest
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.
I reviewed the PR in detail once again and I think this is good to go. I requested a small change in the change log.
I would wait for the v2.0.3 to be released (hopefully today), before merging this, because I think this is more a new feature/improvement, so fits to v2.1.
* main: Reqnroll.Verify: Support for Verify v24 (Verify.Xunit v24.2.0) for .NET 4.7.2+ and .NET 6.0+. (#151, #170) use pull_request_template.md from the .github repo Fix spelling mistake in CONTRIBUTING.md Bump version fix config docs Add release contributors to CHANGELOG (#171) Update CONTRIBUTING with "draft PR" workflow and no force push after review fix CHANGELOG Fix project template binding (#169)
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.
thx!
This PR removes
ITestRunner.TestWorkerId
and related code.Notes
TestThreadContext
is handled byITestRunnerManager
.ITestRunner
is requested, a new instance is created (no caching). This should help to support scenario parallelization (for example Support Scenario-Level Parallelization for MsTest #119).Types of changes
Checklist: