Skip to content

Commit e45ba84

Browse files
authored
Increase http client default timeout to 2s in http-api tests. (#7673)
The `sync_contributions_across_fork_with_skip_slots` test have been quite flaky recently on CI, we suspect it might be caused by the recent introduction of a `default` timeout in #7400, and CI is failing to consistently process those http requests within 1s likely due to limited resources. This PR increases the `default` timeout to 2s in tests to avoid flaky tests, but keeps the remaining timeout the same (1s). https://github.com/sigp/lighthouse/actions/runs/15965113170/job/45023976021 ``` FAIL [ 8.945s] http_api::bn_http_api_tests fork_tests::sync_contributions_across_fork_with_skip_slots stdout ─── running 1 test test fork_tests::sync_contributions_across_fork_with_skip_slots ... FAILED failures: failures: fork_tests::sync_contributions_across_fork_with_skip_slots test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 175 filtered out; finished in 8.91s stderr ─── thread 'fork_tests::sync_contributions_across_fork_with_skip_slots' panicked at beacon_node/http_api/tests/fork_tests.rs:239:10: called `Result::unwrap()` on an `Err` value: HttpClient(url: http://127.0.0.1:41793/, kind: timeout, detail: operation timed out) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
1 parent 6be646c commit e45ba84

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

beacon_node/http_api/src/test_utils.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,21 @@ impl<E: EthSpec> InteractiveTester<E> {
103103

104104
tokio::spawn(server);
105105

106+
// Override the default timeout to 2s to timeouts on CI, as CI seems to require longer
107+
// to process. The 1s timeouts for other tasks have been working for a long time, so we'll
108+
// keep it as it is, as it may help identify a performance regression.
109+
let timeouts = Timeouts {
110+
default: Duration::from_secs(2),
111+
..Timeouts::set_all(Duration::from_secs(1))
112+
};
106113
let client = BeaconNodeHttpClient::new(
107114
SensitiveUrl::parse(&format!(
108115
"http://{}:{}",
109116
listening_socket.ip(),
110117
listening_socket.port()
111118
))
112119
.unwrap(),
113-
Timeouts::set_all(Duration::from_secs(1)),
120+
timeouts,
114121
);
115122

116123
Self {

0 commit comments

Comments
 (0)