Skip to content

Commit 78d5da6

Browse files
authored
Merge pull request #143 from adamrk/abk/fix-flaky-body-fail-test
Fix flaky `response-body-fail` test
2 parents b83cf32 + 5a0e819 commit 78d5da6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎test-programs/tests/http_server.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ fn http_server() -> Result<()> {
151151
// connection
152152
match ureq::get("http://127.0.0.1:8081/response-body-fail").call() {
153153
Err(ureq::Error::Io(_transport)) => {}
154+
Ok(mut response) => match response.body_mut().read_to_vec() {
155+
Err(ureq::Error::Io(_transport)) => {}
156+
body => {
157+
panic!(
158+
"/response-body-fail expected io error, got: {response:?} with body {body:?}",
159+
);
160+
}
161+
},
154162
result => {
155163
panic!("/response-body-fail expected io error, got: {result:?}")
156164
}

0 commit comments

Comments
 (0)