-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass async to tests, parallelizing them
Tests run sync by default. But all of Elixir, essentially, is built to run tests in parallel/async. Unless you mess with the global environment there's usually no reason not to run tests in parallel and it's also best practice to always pass either `async: true` or `async: false` and a reason why they can't be run in parallel. Speeds up the test suite, admittedly not by a lot right now but it's nice. I didn't check all the tests for global state, so this may introduce flakies but on a first couple of runs everything seemed fine. async: ``` root@812d17669fe3:/app# mix test *********.................................................................................................................................................... Finished in 0.7 seconds (0.7s async, 0.00s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 325387 root@812d17669fe3:/app# mix test ***.******................................................................................................................................................... Finished in 0.6 seconds (0.6s async, 0.00s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 874856 root@812d17669fe3:/app# mix test *********.................................................................................................................................................... Finished in 0.7 seconds (0.7s async, 0.00s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 194987 root@812d17669fe3:/app# mix test *********.................................................................................................................................................... Finished in 0.6 seconds (0.6s async, 0.00s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 426291 root@812d17669fe3:/app# mix test ***..******.................................................................................................................................................. Finished in 0.7 seconds (0.7s async, 0.00s sync) 157 tests, 0 failures, 9 skipped ``` sync: ``` root@812d17669fe3:/app# mix test Compiling 3 files (.ex) ......................................................................................******............08:54:11.449 [error] Postgrex.Protocol (#PID<0.394.0>) disconnected: ** (DBConnection.ConnectionError) owner #PID<0.2162.0> exited ...............***................................... Finished in 1.6 seconds (0.00s async, 1.6s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 38709 root@812d17669fe3:/app# mix test .................................................................................******.........................08:54:18.537 [error] Postgrex.Protocol (#PID<0.373.0>) disconnected: ** (DBConnection.ConnectionError) owner #PID<0.2293.0> exited .............***............................. Finished in 1.8 seconds (0.00s async, 1.8s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 848590 root@812d17669fe3:/app# mix test ......................................................................................******...........08:54:22.337 [error] Postgrex.Protocol (#PID<0.374.0>) disconnected: ** (DBConnection.ConnectionError) owner #PID<0.2118.0> exited ..............***..................................... Finished in 1.8 seconds (0.00s async, 1.8s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 729972 root@812d17669fe3:/app# mix test ......................................................................................******........................08:54:26.003 [error] Postgrex.Protocol (#PID<0.375.0>) disconnected: ** (DBConnection.ConnectionError) owner #PID<0.2282.0> exited .......***............................... Finished in 1.9 seconds (0.00s async, 1.9s sync) 157 tests, 0 failures, 9 skipped Randomized with seed 249736 root@812d17669fe3:/app# mix test ..........................................................................******..............................08:54:29.869 [error] Postgrex.Protocol (#PID<0.370.0>) disconnected: ** (DBConnection.ConnectionError) owner #PID<0.2196.0> exited .........***................................... Finished in 1.8 seconds (0.00s async, 1.8s sync) 157 tests, 0 failures, 9 skipped ``` Magically it also seems to have gotten rid off that one error, but really don't ask me why.
- Loading branch information
Showing
28 changed files
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/mindwendel_web/controllers/brainstorming_controller_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/mindwendel_web/controllers/static_page_controller_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/mindwendel_web/live/admin/brainstorming_live/edit_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/mindwendel_web/live/brainstorming_live/show_idea_delete_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/mindwendel_web/live/brainstorming_live/show_idea_edit_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/mindwendel_web/live/brainstorming_live/show_sort_by_label_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/mindwendel_web/live/response_header_content_security_policy_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/repo/data_migrations/migrate_add_lanes_to_brainstormings_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/repo/data_migrations/migrate_idea_labels_to_idea_idea_labels_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters