-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Feature request: Run async tests in parallel within the same file #11409
Comments
The design I've had in mind for a while now is adding a That way async tests marked as safe for parallel execution can simply be partitioned off into a group and awaited on. It would also backwards compatible.
Indeed this is not supported tests with within a module are run in serial by design because most users will have some global shared state.
We're thinking about it, in particular if we were to implement groups then that's a good entry point to enable concurrency for an entire group of tests.
Not sure what you are proposing here. |
Hmm, I don't think they are the same feature though. They're nice proposals for other reasons, but if the goal is just to add more parallelism, it's much simpler for the user to just enable this via a flag. I understand every feature has a cost ofc. If it's not considered worth it then I support closing this issue, I don't think there is anything here to add to #10771, #11235 since they both already enable the user to configure parallelism within a file.
Ah, to elaborate, I mean create an alternative execution environment where tests don't run but instead the test names are emitted for collection. Then you can spin up workers that run tests in a more normal way and feed them test names as needed. This enables parallelism of synchronous tests. Obviously adds significant complexity though, so I just wanted to throw it out there. |
Not really, you'd have to create a group just to run in them concurrently. Thinking ahead to when ES decorators are a thing, I'd prefer simply doing this: @test({ concurrent: true })
async function testFooPrototypeSetBar() {
}
I tried spinning up isolates per tests, was neat but it breaks user expectations of modules only being instantiated once. |
I discussed this with @dsherret and we feel that I'm gonna close this issue for now. |
Previous related issues:
deno test
#6559These seem to be considered resolved via the
-j
flag implemented by #9815.-j
is definitely a welcome improvement. However, it's only enabling separate test files to run parallel. I believe instead the expectation is that parallelism be supported within the same file. In any case, I would like to request this feature.For example:
Running with
-j4
:If parallelism was enabled between these tests, we should expect output more like this:
(Implementing this might be considered a breaking change, requiring a new flag, perhaps
-jj
.)Can you confirm that this kind of parallelism is not yet supported or advise how to enable it?
If it's not supported, are there any intentions to implement this?
(It's also possible to enable this kind of concurrency for synchronous tests, by running a first pass to identify test names and then running separate processes with different filters. Can this also be considered?)
The text was updated successfully, but these errors were encountered: