Skip to content

Commit 381d5aa

Browse files
committed
Resolving some minor README issues
1 parent 981574c commit 381d5aa

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/runtime/parallel/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,28 @@ import { setParallelCanAssign } from '@cucumber/cucumber'
1212
setParallelCanAssign((pickleInQuestion, picklesInProgress) => _.isEmpty(pickleInQuestion.tags)
1313
|| _.every(picklesInProgress, ({tags}) => _.isEmpty(tags) || tags[0].name !== picklesInProgress.tags[0].name))
1414
```
15-
Using the handler above and these assumptions:
16-
* Utilizing 2 workers, `A` and `B`
17-
* Scenarios tagged as `@simple` (2 secs) or `@complex` (3 secs)
18-
* Tests: `[@complex, @complex, @complex, @simple, @simple, @simple]`
15+
* Example using the handler above
16+
* 2 workers, `A` and `B`
17+
* Scenarios tagged as `@simple` (2 secs) or `@complex` (3 secs)
18+
* The first tag of the scenarios: `[@complex, @complex, @complex, @simple, @simple, @simple]`
1919

2020
| Time | WIP | Events |
2121
|---|---|---|
2222
| 0 | | assigned `1 (@complex)` to `worker A` |
2323
| 0 | `@complex` | skip `2 & 3 (@complex)` - assign `4 (@simple)` to `worker B` |
24-
| 2 | `@complex` | skip `2 & 3 (@complex)` - assign `5 (@simple)` to `worker B` |
24+
| 2 | `@complex` | skip `2 & 3 (@complex)` - assign `5 (@simple)` to `worker B` |
2525
| 3 | `@simple` | assign `2 (@complex)` to `worker A` |
2626
| 4 | `@complex` | skip `3 (@complex)` - assign `6 (@simple)` to `worker B` |
2727
| 6 | | assign `3 (@complex)` to `worker A` |
2828
| 9 | | done |
2929

30-
####Note
30+
31+
#### Note
3132
The coordinator doesn't reorder work as it skips un-assignable tests. Also, it always
3233
returns to the beginning of the unprocessed list when attempting to make assignments
33-
to an idle worker. Though assignment to worker 1 may skip the first 3 tests,
34-
assignment to worker 2 will check 1, 2, and 3 as well to determine if they have
35-
become assignable.
34+
to an idle worker. If there was a worker C in the example above, assignment to worker B
35+
would skip 2 & 3 as shown; then assignment to worker C would also skip 2 & 3 upon
36+
checking the test cases against the handler to determine if they have become assignable.
3637

3738
Custom work assignment prioritizes your definition of assignable work over efficiency.
3839
The exception to this rule is if all remaining work is un-assignable, such that all

0 commit comments

Comments
 (0)