From 6b00b97948a6407873ed22501a1c758a066d8a93 Mon Sep 17 00:00:00 2001 From: Jaume Puig Date: Thu, 22 Oct 2026 16:32:42 +0200 Subject: [PATCH] Find the server in real_encode_with_server without a broadcast. The test relied on EncodeServerFinder's UDP broadcast to 255.255.255.255 reaching the server on the same machine. Where a broadcast is not allowed (a sandbox, a machine without a network) no server was found, every frame was encoded locally and the test failed. Ask 127.0.0.1 directly instead, and put the configuration back afterwards (before dropping the finder, which stays connected to Config::Changed). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017CHMGrzt5n5oKGFSjhKnrp --- test/client_server_test.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/client_server_test.cc b/test/client_server_test.cc index 43084bf31d..2536478fb9 100644 --- a/test/client_server_test.cc +++ b/test/client_server_test.cc @@ -325,6 +325,14 @@ BOOST_AUTO_TEST_CASE(real_encode_with_server) auto film = new_test_film("real_encode_with_server", content, &cl); film->set_interop(false); + /* Ask the server on this machine directly rather than broadcasting, as a broadcast may not + * be allowed (e.g. in a sandbox or on a machine without a network). + */ + auto const use_any_servers = Config::instance()->use_any_servers(); + auto const servers = Config::instance()->servers(); + Config::instance()->set_use_any_servers(false); + Config::instance()->set_servers({"127.0.0.1"}); + EncodeServerFinder::instance(); EncodeServer server(true, 4); @@ -336,6 +344,10 @@ BOOST_AUTO_TEST_CASE(real_encode_with_server) server_thread.join(); BOOST_CHECK(server.frames_encoded() > 0); + + Config::instance()->set_use_any_servers(use_any_servers); + Config::instance()->set_servers(servers); + EncodeServerFinder::drop(); cl.run();