Skip to content

Commit f968aea

Browse files
committed
More tips
1 parent 9600848 commit f968aea

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/src/advanced.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ function jltest {
214214

215215
1. **Keep tests isolated**: Each test file runs in its own module, so avoid relying on global state between tests.
216216

217-
2. **Use `init_code` for common setup**: Instead of duplicating setup code in each test file, use `init_code` to share common initialization.
217+
1. **Use `init_code` for common setup**: Instead of duplicating setup code in each test file, use `init_code` to share common initialization.
218218

219-
3. **Filter tests appropriately**: Use `filter_tests!` to respect user-specified test filters while allowing additional programmatic filtering.
219+
1. **Filter tests appropriately**: Use [`filter_tests!`](@ref) to respect user-specified test filters while allowing additional programmatic filtering.
220220

221-
4. **Handle platform differences**: Use conditional logic in your test suite setup to handle platform-specific tests:
221+
1. **Handle platform differences**: Use conditional logic in your test suite setup to handle platform-specific tests:
222222

223223
```julia
224224
testsuite = find_tests(pwd())
@@ -227,4 +227,7 @@ function jltest {
227227
end
228228
```
229229

230-
5. **Use custom workers sparingly**: Custom workers add overhead. Only use them when tests genuinely require different configurations.
230+
1. **Load balance the test files**: `ParallelTestRunner` runs the tests files in parallel, ideally all test files should run for _roughly_ the same time for better performance.
231+
Having few long-running test files and other short-running ones hinders scalability.
232+
233+
1. **Use custom workers sparingly**: Custom workers add overhead. Only use them when tests genuinely require different configurations.

0 commit comments

Comments
 (0)