Skip to content

Commit b0b956b

Browse files
committed
test(auth): wait for callback response
1 parent 8431dad commit b0b956b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/llm_stream/src/auth/listener.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn respond(socket: &mut TcpStream, status: u16, title: &str, message: &str) -> R
120120
#[cfg(test)]
121121
mod tests {
122122
use super::*;
123-
use std::io::Write;
123+
use std::io::{Read, Write};
124124

125125
#[test]
126126
fn the_preferred_port_needs_no_notice() {
@@ -175,6 +175,8 @@ mod tests {
175175
"GET /auth/callback?code=xyz&state=st HTTP/1.1\r\nHost: localhost\r\n\r\n"
176176
)
177177
.expect("write");
178+
let mut response = String::new();
179+
socket.read_to_string(&mut response).expect("read response");
178180
});
179181
assert_eq!(listener.await_code("st").expect("await").as_str(), "xyz");
180182
}

0 commit comments

Comments
 (0)