Skip to content

Commit

Permalink
rejects non 2xx http responses in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Prendes <[email protected]>
  • Loading branch information
jprendes committed Oct 25, 2023
1 parent d2efdc3 commit f5656b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/src/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ mod test {
use crate::{list_pods, random_payload, retry_get, retry_put};
use anyhow::Result;

const RETRY_TIMES: u32 = 5;
const INTERVAL_IN_SECS: u64 = 10;
const RETRY_TIMES: u32 = 25;
const INTERVAL_IN_SECS: u64 = 2;

#[tokio::test]
async fn slight_test() -> Result<()> {
Expand Down
5 changes: 3 additions & 2 deletions tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ pub async fn retry_get(
// verify res is ok and not 404
match res {
Ok(_) => {
if response_code != 404 {
break;
println!("response_code: {}", response_code);
if response_code / 100 == 2 {
break; // 2xx response
}
}
Err(e) => {
Expand Down

0 comments on commit f5656b3

Please sign in to comment.