denoland / denoland/deno

deno test --parallel is sequential per file

Open
#17,511 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
108k
Forks
6.4k
Avg merge
2d 20h
Merged PRs (30d)
58

Description

Firstly deno test is awesome, and parallel makes it very awesome.
It would be great if the test runner could internally parallelize tests that are in the same file

```bash
deno test -A --parallel tests/authenticator_test.ts
Check file:///Users/aricart/Dropbox/code/src/github.com/nats-io/nats.deno/tests/authenticator_test.ts
./tests/authenticator_test.ts => authenticator - username password fns ... ok (2s)
./tests/authenticator_test.ts => authenticator - username string password fn ... ok (2s)
./tests/authenticator_test.ts => authenticator - username fn password string ... ok (2s)
./tests/authenticator_test.ts => authenticator - token fn ... ok (2s)
./tests/authenticator_test.ts => authenticator - nkey fn ... ok (2s)
./tests/authenticator_test.ts => authenticator - jwt bearer fn ... ok (2s)
./tests/authenticator_test.ts => authenticator - jwt fn ... ok (2s)
./tests/authenticator_test.ts => authenticator - creds fn ... ok (2s)

ok | 8 passed | 0 failed (18s)
```

This is a small sample, I have other files that take over 2m to run, but as shown in the example above, what should potentially take 3s total, takes over 18, because tests are sequential when coming from the same file.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with `deno test -A --parallel tests/authenticator_test.ts` and compare the per-test timing with the 18-second total shown in the issue. Trace the `deno test` runner entry point to determine how tests from one file are scheduled; done means tests in the same file can run concurrently without changing their results.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
cli, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.