[feature]: Improve test harness to enable more complex test cases
Author: alloczCreated Jun 30, 2026Updated Jul 1, 2026
Labelsenhancement
The current Harness under integration/rpctest/rpc_harness.go would be more powerful if we add the following features:
- Log assertion: an option accepting a func(string) which is called for each btcd log line, allowing matching on log messages.
- Stop procedure: stops btcd returning the exit code, to test scenarios where btcd exits with error or scenarios where the node should be restarted.
- Start procedure: allows the harness to be started again after
stopis called. - Change
New()signature: pass opts as single nullable pointer to struct instead of having to pass multiple zero values to get default initialization.
This would make possible write tests for complex scenarios, and create incentives to write more integration tests.
1 and 4 already addressed on https://github.com/allocz/btcd/pull/7, which currently allow setting an alternative node directory to work around the missing 2 and 3.
Source: btcsuite/btcd