diff --git a/AGENTS.md b/AGENTS.md index 8506157..40100de 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,8 +9,8 @@ - **Clarity over cleverness.** Be concise, but favour explicit over terse or obscure idioms. Prefer code that's easy to follow. - **Use functions and composition.** Avoid repetition by extracting reusable - logic. Prefer generators, comprehensions, and declarative code to - imperative repetition when readable. + logic. Prefer generators, comprehensions, and declarative code to imperative + repetition when readable. - **Small, meaningful functions.** Functions must be small, clear in purpose, single responsibility, and obey command/query segregation. - **Clear commit messages.** Commit messages should be descriptive, explaining diff --git a/tests/steps/listener_steps.rs b/tests/steps/listener_steps.rs index 88780ac..4ac9802 100644 --- a/tests/steps/listener_steps.rs +++ b/tests/steps/listener_steps.rs @@ -60,13 +60,24 @@ async fn running_listener(world: &mut ListenerWorld) { world.writer = Some(writer); world.receiver = Some(receiver); world.handle = Some(handle); - // wait for socket create + + // wait up to 100 ms for the socket file to appear + let socket_path = &world + .cfg + .as_ref() + .expect("config not initialised in ListenerWorld") + .socket_path; for _ in 0..10 { - if world.cfg.as_ref().unwrap().socket_path.exists() { + if socket_path.exists() { break; } sleep(Duration::from_millis(10)).await; } + assert!( + socket_path.exists(), + "socket file {} not created within timeout", + socket_path.display() + ); } #[when("a client sends a valid request")]