Skip to content

Commit 76dcd2e

Browse files
authored
Fix How To Perform HTTP Requests readme test in CI (#3783)
## Motivation The README test for the How To Perform HTTP Requests example was failing in CI, but not locally. After investigating the issue, the cause seems to be a race condition by running `cargo run --bin test_http_server &` in the background. This command didn't immediately start the test HTTP server, because it had to be built first, and that meant that on some computers (like in the CI) it could end up starting too late. ## Proposal Build the `test_http_server` binary in the foreground, so that the `cargo run` command in the background is guaranteed to start the test HTTP server right afterwards. ## Test Plan CI now passes, whereas it previously failed without this fix. ## Release Plan - Nothing to do, because this only refactors a step in the README. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist) - Closes #3743
1 parent 9d89027 commit 76dcd2e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/how-to/perform-http-requests/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ For the test, a simple HTTP server will be executed in the background.
6565
```bash
6666
HTTP_PORT=9090
6767
cd examples
68+
cargo build --bin test_http_server
6869
cargo run --bin test_http_server -- "$HTTP_PORT" &
6970
cd ..
7071
```

linera-service/tests/readme_test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ use tokio::process::Command;
2525
#[test_case::test_case("../examples/crowd-funding" ; "crowd funding")]
2626
#[test_case::test_case("../examples/fungible" ; "fungible")]
2727
#[test_case::test_case("../examples/gen-nft" ; "gen-nft")]
28-
// TODO(#3743): Fix this test and re-enable it.
29-
// #[test_case::test_case("../examples/how-to/perform-http-requests" ; "how-to-perform-http-requests")]
28+
#[test_case::test_case("../examples/how-to/perform-http-requests" ; "how-to-perform-http-requests")]
3029
#[test_case::test_case("../examples/hex-game" ; "hex-game")]
3130
#[test_case::test_case("../examples/llm" ; "llm")]
3231
#[test_case::test_case("../examples/native-fungible" ; "native-fungible")]

0 commit comments

Comments
 (0)