From 01bf128c5893283750c23f2cd2c975a9589cba17 Mon Sep 17 00:00:00 2001 From: faumaray Date: Tue, 27 Oct 2026 19:32:14 +0300 Subject: [PATCH] voelin-gpui: the connect test makes no DNS query a_connect_reaches_the_engine_and_its_answer_reaches_the_rail connects a server called ts.example, and a connect looks the server's gateway up: SRV queries for _tsgws._tcp.ts.example sent to the resolver (docs/ci.md says tests use no DNS). The test now marks the lookup done before the connect, as the second connect of a run finds it, and its comment says so (it also claimed nothing left the machine). strace -f -e trace=connect,sendto,sendmsg,sendmmsg on the lib test binary: the old binary's test sends to 127.0.0.53:53 (and asks nscd over a unix socket); the new one, alone and with all 79 tests of the binary, makes no connect and no send at all. Co-Authored-By: Claude Sonnet 5.5 --- crates/voelin-gpui/src/app.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/voelin-gpui/src/app.rs b/crates/voelin-gpui/src/app.rs index 909911d..39feb0b 100644 --- a/crates/voelin-gpui/src/app.rs +++ b/crates/voelin-gpui/src/app.rs @@ -1309,9 +1309,12 @@ mod tests { } /// The real path of a connect: the action's method sends the command, the - /// engine (with no connector, so that nothing leaves the machine and no - /// sound device opens) takes it and answers with its events, which the - /// entity's loop turns into the state the rail shows. + /// engine (with no connector, so that no sound device opens) takes it and + /// answers with its events, which the entity's loop turns into the state + /// the rail shows. A connect also looks the server's gateway up, which is + /// DNS (SRV queries for the server's name) and docs/ci.md says tests use + /// none: the lookup is marked done before the connect, as a second connect + /// of a run finds it, so nothing leaves the machine. #[gpui::test] fn a_connect_reaches_the_engine_and_its_answer_reaches_the_rail(cx: &mut TestAppContext) { cx.executor().allow_parking(); @@ -1330,7 +1333,10 @@ mod tests { }; let app = cx.new(|cx| AppState::new(setup, cx)); let id = app.read_with(cx, |app, _| app.vm.bookmarks[0].id); - app.update(cx, |app, cx| app.connect_voice(cx)); + app.update(cx, |app, cx| { + app.vm.gateways_looked_up.insert(id); + app.connect_voice(cx) + }); app.read_with(cx, |app, _| { assert_eq!(app.vm.status, "Connecting to ts.example…"); });