Add a shared gate test helper and park node threads with it (#5295) * Add a shared gate test helper A copyable gate in nano::test, next to the other shared values, that holds the callbacks waiting on it until the test opens it and counts the callers it holds. Tests use it to park a node thread at a known point. A wait gives up after a timeout, so a test that fails before opening the gate cannot hang the node's teardown. * Park node threads in tests with the shared gate The tests that held a node callback on a promise and a shared future now use nano::test::shared_gate. Its count of waiting callers replaces the flag fork_cached_before_publish captured by reference, which the node could still write after the test body returned. * Scale the shared gate's timeout like test deadlines The gate gave up after 30 s however far DEADLINE_SCALE_FACTOR stretched the test's deadlines, so a slow run that still met them could see a parked callback resume early and fail its check of the wait. The wait now multiplies its timeout by the same factor, which moves into nano::test::deadline_scaling_factor () so the test system and the gate read it from one place. * Rename DEADLINE_SCALE_FACTOR to NANO_TEST_DEADLINE_SCALE_FACTOR The deadline scale only affects tests, so it takes the NANO_TEST_ prefix the other test environment variables carry. The CI workflows and the docker test script set it under the new name, and the tests read it through nano::env::get.
__________
Type: commit
Hash: 40ecc5991528fb4127acda5aa52800be7852e563
Created: today
__________
gr0v1ty/nano-node:40ecc5991528fb4127acda5aa52800be7852e563
| Test Case | Status | Duration | Median Deviation | Log | Graph |
|---|---|---|---|---|---|
| 5n4pr_conf_10k_bintree | PASS | 102 s | -6.0 s | GitHub job logs | Show |
| 5n4pr_conf_10k_change | PASS | 126 s | 0.0 s | GitHub job logs | Show |
| 5n4pr_conf_change_dependant | PASS | 110 s | -1.0 s | GitHub job logs | - |
| 5n4pr_conf_change_independant | PASS | 104 s | -5.0 s | GitHub job logs | - |
| 5n4pr_conf_send_dependant | PASS | 96 s | -13.0 s | GitHub job logs | - |
| 5n4pr_conf_send_independant | PASS | 112 s | 0.0 s | GitHub job logs | - |
| 5n4pr_rocks_10k_bintree | PASS | 110 s | 1.0 s | GitHub job logs | - |
| 5n4pr_rocks_10k_change | PASS | 136 s | -20.0 s | GitHub job logs | - |