59 Commits

Author SHA1 Message Date
Eric
fa91a642b9
revert posix-only verbose unittest output
It didn't fix the error with invalid proofs in windows in ci
2025-06-04 16:07:01 +10:00
Eric
99fa6b8a16
fix previous commit compilation 2025-06-04 16:07:00 +10:00
Eric
38a4f864da
try removing verbose output to see if windows ci passes 2025-06-04 16:07:00 +10:00
Eric
e12426fff7
verbose unittest2 output to stdout 2025-06-04 16:06:15 +10:00
Eric
6bb7457824
fix compilation errors in windows 2025-06-04 16:01:27 +10:00
Eric
75047f52be
force kill windows test processes
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)
2025-06-04 16:01:27 +10:00
Eric
67ebe0b3e3
Don't store hardhat logs in memory and do not print to term even if DebugHardhat=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.
2025-06-04 16:01:26 +10:00
Eric
91b5084047
add new line to stdout/stderr logs when logging lines 2025-06-04 15:58:33 +10:00
Eric
ec40d73d0d
write to stdout/stderr as the stream is read, rearrange node stop logging 2025-06-04 15:58:32 +10:00
Eric
cca846f073
remove unneeded exception from start raises 2025-06-04 15:58:32 +10:00
Eric
3eb1edceb4
Remove noCancel from captureProcessOutput call 2025-06-04 15:58:31 +10:00
Eric
7610b4e8bf
Continuously read from stdout/stderr to prevent buffers from filling 2025-06-04 15:58:31 +10:00
Eric
2ebf7b1568
reinstate logging after it also failed on windows and ci 2025-06-04 15:58:31 +10:00
Eric
4789f6a879
disable all logging to see if windows passes 2025-06-04 15:58:31 +10:00
Eric
b3162061e8
Move test assertions at end of start so that test.status can be set after timeout 2025-06-04 15:58:31 +10:00
Eric
1f859b24fe
Add wait to stdout/stderr stream future 2025-06-04 15:58:30 +10:00
Eric
061ccce403
fix windows issue where reading stdout/stderr hangs forever 2025-06-04 15:58:30 +10:00
Eric
06337a0512
ensure runTests doesn't raise CancelledError
TrackedFutures now only accepts Futures that do not raise any exceptions
2025-06-04 15:58:30 +10:00
Eric
d2734a686e
Remove DebugCodexNodes
- Codex nodes will log to file by default, so this parameter could be removed.
- Add NoCodexLogFilters define, that unsets chronicles' topic filters when logging codex nodes chronicles logs to file
2025-06-04 15:58:30 +10:00
Eric
ee0d2866c8
Add debugging and assertions after test run
Mostly to debug in windows
2025-06-04 15:58:29 +10:00
Eric
5ff15da492
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-06-04 15:56:03 +10:00
Eric
831ad9170b
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-06-04 15:56:03 +10:00
Eric
8f21cacc79
Ensure started tests are torn down properly on timeout 2025-06-04 15:56:03 +10:00
Eric
1051e464e0
Colorise stdout from test runs
Adds terminal colour to [OK], [FAILED], and [Suite]

# Conflicts:
#	tests/integration/testmanager.nim
2025-06-04 15:55:18 +10:00
Eric
ca62539e9c
Refactor process launch
Refactor to keep a process handle so that the processes can be stopped on timeout.
2025-06-04 15:55:17 +10:00
Eric
0309cfd063
run tests async from start so that stop can cancel all tracked futures 2025-06-04 15:55:17 +10:00
Eric
fc63ee188e
clean up 2025-06-04 15:55:16 +10:00
Eric
9cd9f5e29f
increase port gap by 1000 to avoid clashes in windows 2025-06-04 15:55:16 +10:00
Eric
c196920d20
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-06-04 15:55:15 +10:00
Eric
405eb370b3
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-06-04 15:54:29 +10:00
Eric
eb50409356
fix: hardhot not being stopped when test times out 2025-06-04 15:54:29 +10:00
Eric
6d9cac3892
handle cancellations for race and allFutures 2025-06-04 15:54:27 +10:00
Eric
09ccdfaa2b
nil check hardhat process before stopping 2025-06-04 15:54:27 +10:00
Eric
809558e9a7
fix exit status 2025-06-04 15:54:26 +10:00
Eric
a6214d693b
indicate with exit code 1 if the tests failed 2025-06-04 15:54:26 +10:00
Eric
e8d28499b6
fix: pass show continuous updates into test manager instance 2025-06-04 15:54:26 +10:00
Eric
034bbc7672
undo changes done for CI debugging 2025-06-04 15:50:47 +10:00
Eric
b20b12a232
Back off port inc in the hopes that this is causing issues with CI 2025-06-04 15:49:17 +10:00
Eric
d2be32f7b0
use tracked futures for showContinuousStatusUpdates 2025-06-04 15:49:16 +10:00
Eric
d0c3da654c
formatting 2025-06-04 15:49:16 +10:00
Eric
7a855f0f2b
remove unneeded sleep 2025-06-04 15:47:40 +10:00
Eric
0ab4ec2678
increase port distance per test run 2025-06-04 15:47:40 +10:00
Eric
44537f8285
add constructor param for continuous status update in terminal
# Conflicts:
#	tests/testIntegration.nim
2025-06-04 15:47:40 +10:00
Eric
a83142bfc2
ensure timeouts work
Work around the AsyncProcess timeout not working correctly
2025-06-04 15:47:39 +10:00
Eric
7dfd5e5f3e
continually show test status updates
allows user to know which tests are still running
2025-06-04 15:47:39 +10:00
Eric
77b0bbc11e
cleanup
# Conflicts:
#	tests/testIntegration.nim
2025-06-04 15:47:39 +10:00
Eric
0c55913ff9
lock hardhat start to avoid intermittent start failures 2025-06-04 15:47:39 +10:00
Eric
aa1a52eb4f
clean up 2025-06-04 15:47:39 +10:00
Eric
f3f9e6c791
print hardhat testmanager errors and hardhat stdout when there is an error starting hardhat 2025-06-04 15:47:38 +10:00
Eric
90bb75bb85
hang manager off IntegrationTest, cleanup
- add a TestManager property to IntegrationTest, so manager does not need to be passed into all functions
- cleanup:
  - remove unneeded stopHardhat function
  - add hardhat instance to manager outside of startHardhat
2025-06-04 15:47:38 +10:00