-
Notifications
You must be signed in to change notification settings - Fork 27
feat(integration): Parallelize integration tests #1086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
emizzle
wants to merge
137
commits into
master
Choose a base branch
from
feat/integration/parallelize-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
9c3c2dd
to
3b79379
Compare
f402de4
to
59cf143
Compare
59cf143
to
2a81eb4
Compare
384d28b
to
d3a2668
Compare
2a81eb4
to
e8b0356
Compare
Base automatically changed from
chore/integration/simplify-block-expiration-tests
to
master
February 20, 2025 07:00
50b6bee
to
5b6c2aa
Compare
edd082d
to
7e14753
Compare
f24bcee
to
95804c6
Compare
d7d80e8
to
17b84b2
Compare
- need to test with longer tests to ensure the parallelisation is truly happening - is the +10 hardhat port needed? - try with more integration tests # Conflicts: # tests/integration/hardhatprocess.nim # tests/integration/multinodes.nim # tests/integration/testcli.nim # tests/testIntegration.nim
# Conflicts: # tests/testIntegration.nim
# Conflicts: # tests/testIntegration.nim
# Conflicts: # tests/testIntegration.nim
# Conflicts: # tests/integration/hardhatprocess.nim
prevents showing error in the logs when an expected process exit code is encountered # Conflicts: # tests/integration/testcli.nim
# Conflicts: # tests/integration/testcli.nim
Windows hangs when attempting to hardhat's process streams, so try to kill the process externally. TODO: This doesn't actually kill the process, as the pid given by chronos is an msys2 pid, and the command is used to kill a windows process. `ps -ef` in msys2 also doesn't show hardhat running as a process, so the only way to kill the process is to kill it with the windows pid. So we need to figure out a way to get a windows pid from the msys2 pid.
On windows, termination of hardhat processes would not actually kill the process, and then closing the process' streams would then hang the calling nim process. To get around this, the process is now killed externally using a script, winkillhardhat.sh. This script first queries open processes by inspecting the command line value of all "node.exe" processes, searching for "vendor/codex-contracts-eth" and for the port parameter it was started with. After querying, the process is killed using the `Stop-Process` powershell command (passing the pid of the windows process).
… params of eventually With this fix in, there is no need to use the asynctest update that sets longer defaults for eventually, so downgrade asynctest
Since the HttpClient now supports async, re-enable debug logging in the Codex nodes
…ebugHardhat=true Hardhat output is logged to file in hardhat.log for each test, and printing to screen is not necessarily needed as it is already logged to file and can create clutter in the output, so stop writing logging output to memory and writing to screen.
In situations like timeouts, windows will hang when attempting to close the test process streams. In this case, we have to force kill the test process externally. This is the same process as force killing hardhat nodes after they are already terminated, but windows refuses hangs when closing their process streams. This commit creates a forceKillProcess utility that allows a process to be killed by its process name and matching commandline criteria, like TestId (for test process) or --port (for hardhat)
Because `eventuallySafe` calls the symbol `eventually`, it should be declared before `proc eventually` is declared to avoid ambiguous symbol lookups.
Also adds a condition such that a hardhat node is not started for parallel integration tests
f55c792
to
b3bc587
Compare
It didn't fix the error with invalid proofs in windows in ci
Windows CI is consistently failing with invalid proof, so increasing the period duration may help alleviate this, allowing SPs to fill slots when they're bogged down with proving multiple slots.
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.
Runs integration tests in parallel, by running each integration test file specified in
testIntegration
in a separate process. Note, this is all still single threaded, using chronos'AsyncProcess
.The result is that the integration tests run about 60% faster locally (~26 mins on my machine) than if run serially.

I will update this description with the results in CI..
Configuration
There are few options for configuring the
TestManager
, which can be set in the following ways:make testIntegration
command, eg:testIntegration
directly. This option is probably faster assuming that the codex binary does not need to re-built each time. For example:tests/testIntegration.nim
Chronicles logs
For chronicles logs
Option definitions
Default values indicate what values are set when
make testIntegration
is run.debugTestHarness
DEBUG_TESTHARNESS
false
debugHardhat
DEBUG_HARDHAT
false
debugCodexNodes
DEBUG_CODEXNODES
true
true
so that the output ofunittest/unittest2
in stdout will be shown, ie[Suite] <suite name>
and[Test] <test name>
, egshowContinuousStatusUpdates
DEBUG_UPDATES
false
testTimeout
TEST_TIMEOUT
60.minutes