From e5d27c514ce9f5bfeb517573558ce04297de7b20 Mon Sep 17 00:00:00 2001 From: Amod Malviya Date: Sat, 4 May 2024 19:11:11 +0530 Subject: [PATCH] ios: fix test timeout --- .github/workflows/ios.yaml | 2 ++ tests/common.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios.yaml b/.github/workflows/ios.yaml index adb68a5..0636a20 100644 --- a/.github/workflows/ios.yaml +++ b/.github/workflows/ios.yaml @@ -48,6 +48,8 @@ jobs: # Run tests - name: Run tests run: cargo +${{ matrix.rust }} test --verbose --test test_ios -- --include-ignored --nocapture + env: + TEST_REQ_TIMEOUT: '300' # Code format, linting etc. - name: Check Code Formatting diff --git a/tests/common.rs b/tests/common.rs index b88ab39..aa2c464 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -81,7 +81,9 @@ where op(&format!("http://{}:{}{}", host, port, &uri), port); // wait for the url to be hit - let timeout = if cfg!(target_os = "ios") { 360 } else { 90 }; + let timeout = option_env!("TEST_REQ_TIMEOUT") + .map(|s| s.parse().expect("failed to parse TEST_REQ_TIMEOUT")) + .unwrap_or(90); match rx.recv_timeout(std::time::Duration::from_secs(timeout)) { Ok(msg) => assert_eq!(decode(&msg).unwrap(), uri), Err(_) => panic!("failed to receive uri data"),