529 Commits

Author SHA1 Message Date
Eric
6057d5ac45
do not re-raise CancelledError as convertError not used in async procs 2025-11-04 20:16:02 +11:00
Eric
2695b46dc4
re-raise CancelledError 2025-11-04 20:16:02 +11:00
Eric
b9dd464a93
readd prevention of hanging when closing process streams on windows 2025-11-04 20:16:02 +11:00
Eric
1dc20de0c2
Add debugging and assertions after test run
Mostly to debug in windows
2025-11-04 20:16:01 +11:00
Eric
0bdba3fb99
formatting 2025-11-04 20:16:01 +11:00
Eric
da6097155c
formatting 2025-11-04 20:16:01 +11:00
Eric
919f46b2e1
Fix process hanging after restart 2025-11-04 20:16:01 +11:00
Eric
dff1ca961f
refactor: debug and logging
- Move test manager values to config object
- Increase codex port separation (between api and disc ports) in an attempt to prevent overlap across tests (ie Test1: api=8000(tcp), disc=9000(udp), and Test2: api=9000(tcp), disc=10000(udp))
- print stderr when exitcode == 1 if there's < 3 lines of stdout
- Logging:
  - Always write test manager harness chronicles logs to file, ie testmanager.chronicles.log in the root of the `integration/logs/<run name>` dir
  - Always write individual test stdout to file, ie `<test file name>.stdout.log` in the root of the `integration/logs/<run name>/<test file name>` dir
  - On error, print stderr to screen and write stderr to file. Or on failure, if stdout is sufficiently short, write stderr to screen and file in `integration/logs/<run name>/<test file name>/<test file name>.stderr.log`
  - When debugging, ie DebugCodexNodes == true
- Removes DebugTestHarness from controlling anything other than printing chronicles output from the testmanager to the terminal
- Now, if DebugCodexNodes is set to true:
  - Codex node (chronicles) output for multinodesuite tests is logged to file, eg `integration/logs/<run name>/<test file name>/<test name>/<role>_<idx>.log`
  - Codex chronicles output is logged to stdout, which also written to file (see above)
2025-11-04 20:16:01 +11:00
Eric
a1ea23007f
enable more logging to file
- test harness chronicles logs to log file
- test process stdout and stderr to log file for each integration test file

Note: does not work when DEBUG=1 is not present in make command
2025-11-04 20:16:00 +11:00
Eric
e83a692b03
Ensure started tests are torn down properly on timeout 2025-11-04 20:15:16 +11:00
Eric
7d29afbae8
filter out log topics that are making too much noise
- set disabled topics during codex compilation due to lack of support for disabling chronicles topics at runtime in codex
- ensure that TRACE logs are set for nodes running in multinodesuite when DebugCodexNodes is set
- add TRACE loglevel to testcli
2025-11-04 20:15:16 +11:00
Eric
ff62751cce
Colorise stdout from test runs
Adds terminal colour to [OK], [FAILED], and [Suite]

# Conflicts:
#	tests/integration/testmanager.nim
2025-11-04 20:12:44 +11:00
Eric
53a3a2ae18
Refactor process launch
Refactor to keep a process handle so that the processes can be stopped on timeout.
2025-11-04 20:12:44 +11:00
Eric
8a8030c298
run tests async from start so that stop can cancel all tracked futures 2025-11-04 20:12:44 +11:00
Eric
d968ef9a39
Add proper async exception tracking to multinodesuite 2025-11-04 20:12:44 +11:00
Eric
821393d025
formatting 2025-11-04 20:12:43 +11:00
Eric
afe31d7319
clean up 2025-11-04 20:12:42 +11:00
Eric
7c2254a249
increase port gap by 1000 to avoid clashes in windows 2025-11-04 20:12:11 +11:00
Eric
bc694765a9
lock codex port selection in multinodesuites
Codex api/disc ports were clashing in windows because `lastUsedCodexApiPort` and `lastUsedCodeexDiscPort` were not locked when read and written, while client and provider nodes were started concurrently (async).
2025-11-04 20:12:11 +11:00
Eric
bb7dfc24f1
add test name to datadir path
avoids reusing datadirs between tests
2025-11-04 20:12:11 +11:00
Eric
1188360197
update Make flag to simply debug
DEBUG -> enables DebugCodexNodes, DebugTestHarness, and ShowContinuousStatusUpdates
DEBUG_HARDHAT -> enables DebugHardhat
PARALLEL -> enables EnableParallelTests

Additionally, when DEBUG is enabled, all integration tests debug configs are enabled for Codex nodes, the Codex node output is printed with the test output (not interleaved), and the Codex node output is logged to file in `tests/integrations/logs/<starttime>__IntegrationTests/<integration_test_name>/<suite_name>/<testname>/<role>_<idx>.log`.
When DEBUG_HARDHAT is enabled, all hardhat output is printed with the test output (not interleaved), and the output is also written to a log file in `tests/integrations/logs/<starttime>__IntegrationTests/<integration_test_name>/hardhat.log
2025-11-04 20:12:11 +11:00
Eric
33c33d5210
cancel processes soon
Windows really does not like to terminate processes, so if we try to cancel the process, we will hang in Windows.
2025-11-04 20:12:11 +11:00
Eric
84589ebd64
fix: hardhot not being stopped when test times out 2025-11-04 20:12:10 +11:00
Eric
f0e66df3f7
Allow parallel integration tests to be disabled
Disable with `make ENABLE_PARALLEL_TESTS=0 testIntegration`
2025-11-04 20:12:10 +11:00
Eric
0c680dcefc
fix: use the last used port instead of the globally defined port 2025-11-04 20:10:53 +11:00
Eric
4a4016acbc
Increase hardhat, codex api, and codex discovery ports for each subsequent test
Previously, each test would start with a port specified by a global const and overwritable using `define` cli flag. This seems to be causing some port clashes that `nextFreePort` is not picking up. Instead of relying on `nextFreePort`, do not reuse port numbers for any of the tests.
2025-11-04 20:10:52 +11:00
Eric
0c6f1871ea
enable debug logs for testpurchasing since the failure in ci 2025-11-04 20:10:52 +11:00
Eric
13f94a64ac
fix waiting for hardhat node process exit on windows 2025-11-04 20:10:34 +11:00
Eric
0b25406241
handle cancellations for race and allFutures 2025-11-04 20:10:34 +11:00
Eric
99d161ba1b
fix hardhat running on windows
Solution was two-fold:
1. Run the hardhat.cmd script instead of hardhat
2. Use the absolute path to the script executable instead of relative to the working directory
2025-11-04 20:10:33 +11:00
Eric
98df5bf2ec
Bubble errors from hardhat start
- bubble errors from hardhatprocess.start (instead of just logging)
- push raises: [] in all nodeprocess procs/methods to avoid leaking `Exception` exception types in method overrides
2025-11-04 20:09:34 +11:00
Eric
d3b5d3b1e6
nil check hardhat process before stopping 2025-11-04 20:08:18 +11:00
Eric
b73c91b129
fix exit status 2025-11-04 20:08:18 +11:00
Eric
91f3f85ccd
indicate with exit code 1 if the tests failed 2025-11-04 20:07:48 +11:00
Eric
477c1409d1
fix: pass show continuous updates into test manager instance 2025-11-04 20:07:48 +11:00
Eric
d60c6f7ff1
undo changes done for CI debugging 2025-11-04 20:06:47 +11:00
Eric
84d3d5ad9a
Back off port inc in the hopes that this is causing issues with CI 2025-11-04 20:06:27 +11:00
Eric
fb48ef889b
formatting
trying to make nph happy
2025-11-04 20:02:28 +11:00
Eric
86cce5b3a4
formatting 2025-11-04 20:02:28 +11:00
Eric
30d30080a8
clean up 2025-11-04 20:02:28 +11:00
Eric
ace3644f2d
use tracked futures for showContinuousStatusUpdates 2025-11-04 20:02:28 +11:00
Eric
0e9b42fa39
formatting 2025-11-04 20:02:28 +11:00
Eric
c37dce8cfd
format info blurbs 2025-11-04 20:02:27 +11:00
Eric
cb31039c6c
allow test parameters to be set from make testIntegration command 2025-11-04 20:02:27 +11:00
Eric
6db6e6c2eb
DIsable continuous updates by default (for CI) 2025-11-04 20:02:27 +11:00
Eric
6ccd84b94f
fix rebase, formatting 2025-11-04 20:02:27 +11:00
Eric
f9c52ccc63
fix rebase 2025-11-04 20:02:27 +11:00
Eric
8f43789269
Use absolute path for binary when checking for existence 2025-11-04 20:02:26 +11:00
Eric
53614572e6
fail early with message when hardhat binary not found
# Conflicts:
#	tests/integration/hardhatprocess.nim
2025-11-04 20:02:26 +11:00
Eric
cb0b3023c8
remove unneeded sleep 2025-11-04 20:02:26 +11:00