Run DB integration tests concurrently#2134
Draft
sgillespie wants to merge 4 commits into
Draft
Conversation
b374c60 to
20edc9c
Compare
Previously, there were some tests that duplicated testLabels (copy/paste errors). This is a prerequisite for running tests in parallel, as the per-test state directory (`testfiles/temp/<testLabel>`) could have collided.
Prerequisite for running tests concurrently. All DB tests share the same database, so we can read the from the `PGPASSFILE` environment variable. When we run them in parallel, this won't be possible, since each running test will need its own database. Instead, explicitly pass the `PGConfig` to all tests, which will allow different database configs per test run.
The DB integration test suite now runs the groups concurrently: * Alonzo-era * Babbage-era * Conway-era * QSM (QuickCheck State Machine) Concurrent tests cannot share a database, so each group has its own copy. Grouping at the top level keeps the databases/threads manageable. Also, add the required databases in the nix `preCheck` hook and GitHub CI workflows.
20edc9c to
d2af3cc
Compare
This allows the user to add `-j N` to control how many threads to run
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Run top-level test groups concurrently
The DB integration test suite now runs the groups concurrently:
Concurrent tests cannot share a database, so each group has its own
copy. Grouping at the top level keeps the databases/threads manageable.
Note that this is the first iteration of parallelizing the tests. It results in a roughly 50% decrease in total execution time. However, this approach cannot scale anymore, because the floor is the Conway test, which takes at least 6 minutes.
In the future, we will probably want to use a database pool aquire/release pattern.
Checklist
fourmoluon version 0.17.0.0 (which can be run withscripts/fourmolize.sh)Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.