test(daemon): make socket/pty integration tests robust under parallel load
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -309,7 +309,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn open_new_surface_attach_streams_output() {
|
||||
let dir = tempdir_path();
|
||||
let sock = dir.join("sock");
|
||||
@@ -335,7 +335,7 @@ mod tests {
|
||||
|
||||
// Now read frames looking for an Output evt containing STREAM_OK.
|
||||
let mut got = String::new();
|
||||
let deadline = tokio::time::Instant::now() + tokio::time::Duration::from_secs(2);
|
||||
let deadline = tokio::time::Instant::now() + tokio::time::Duration::from_secs(6);
|
||||
while tokio::time::Instant::now() < deadline {
|
||||
if let Ok(Ok(Some(Envelope::Evt(Evt::Output { bytes, .. })))) =
|
||||
tokio::time::timeout(tokio::time::Duration::from_millis(200), read_frame(&mut s)).await {
|
||||
@@ -346,7 +346,7 @@ mod tests {
|
||||
assert!(got.contains("STREAM_OK"), "got: {got:?}");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn unknown_surface_returns_not_found() {
|
||||
let dir = tempdir_path();
|
||||
let sock = dir.join("sock");
|
||||
@@ -380,7 +380,7 @@ mod tests {
|
||||
}
|
||||
|
||||
async fn wait_for_socket(sock: &Path) {
|
||||
for _ in 0..100 {
|
||||
for _ in 0..300 {
|
||||
if UnixStream::connect(sock).await.is_ok() { return; }
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(20)).await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user