Skip to content

Commit 314b8dd

Browse files
authored
Merge pull request #744 from nicholasbishop/bishop-retry-udp-2
test-runner: Speculative fix for Windows CI timeout
2 parents 53731a2 + a58fc8a commit 314b8dd

File tree

1 file changed

+14
-4
lines changed
  • uefi-test-runner/src/proto/network

1 file changed

+14
-4
lines changed

uefi-test-runner/src/proto/network/pxe.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,27 @@ pub fn test(bt: &BootServices) {
8080
let mut dest_port = write_src_port;
8181
let mut header = [0; 1];
8282
let mut received = [0; 4];
83-
base_code
84-
.udp_read(
83+
84+
// The Windows CI job sometimes fails the read with a timeout error;
85+
// retry a few times before giving up.
86+
let mut read_result = Ok(0);
87+
for i in 0..5 {
88+
read_result = base_code.udp_read(
8589
UdpOpFlags::USE_FILTER,
8690
Some(&mut dest_ip),
8791
Some(&mut dest_port),
8892
Some(&mut src_ip),
8993
Some(&mut src_port),
9094
Some(&mut header),
9195
&mut received,
92-
)
93-
.unwrap();
96+
);
97+
if read_result.is_ok() {
98+
break;
99+
}
100+
101+
info!("Read attempt {i} failed: {read_result:?}");
102+
}
103+
read_result.unwrap();
94104

95105
// Check the header.
96106
assert_eq!(header[0] as usize, payload.len());

0 commit comments

Comments
 (0)