From 7ef274600d5e7c83d4e94336aac30f974209db9c Mon Sep 17 00:00:00 2001 From: piegames Date: Thu, 14 May 2026 15:15:26 +0200 Subject: [PATCH] testlib: default nix fixture to also test all daemon protocols (3/3) This is the real deal. The new tests have surfaced one bug in the test suite itself, and one in the RPC legacy protocol wrapper. Co-authored-by: eldritch horrors Change-Id: Id75b671c10b45655d3627abd88563e2d41719446 --- lix/libstore/daemon.cc | 1 + tests/functional2/daemon/test_rpc_setup.py | 1 + tests/functional2/testlib/fixtures/nix.py | 4 +--- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lix/libstore/daemon.cc b/lix/libstore/daemon.cc index 7c03d1ad8..f8748294a 100644 --- a/lix/libstore/daemon.cc +++ b/lix/libstore/daemon.cc @@ -898,6 +898,7 @@ static void processLegacyRequests( debug("performing daemon worker op: %d", op); try { + KJ_DEFER(aio.blockOn(logger->flush())); performOp(aio, tunnelLogger, store, trusted, clientVersion, from, to, op); } catch (Error & e) { /* If we're not in a state where we can send replies, then diff --git a/tests/functional2/daemon/test_rpc_setup.py b/tests/functional2/daemon/test_rpc_setup.py index 7eba64826..739b6fa76 100644 --- a/tests/functional2/daemon/test_rpc_setup.py +++ b/tests/functional2/daemon/test_rpc_setup.py @@ -12,6 +12,7 @@ def test_legacy_sockets_always_appear(nix: Nix, daemon: NixDaemon): assert (sockets_dir / "socket").is_socket() +@pytest.mark.no_daemon # We do the daemon config ourselves here @pytest.mark.parametrize("daemon", ["legacy"], indirect=True) def test_xp_sockets_dont_always_appear(nix: Nix, daemon: NixDaemon): sockets_dir = nix.env.dirs.nix_state_dir / "daemon-socket" diff --git a/tests/functional2/testlib/fixtures/nix.py b/tests/functional2/testlib/fixtures/nix.py index 68986b189..ade2a9326 100644 --- a/tests/functional2/testlib/fixtures/nix.py +++ b/tests/functional2/testlib/fixtures/nix.py @@ -445,9 +445,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc): if "nix" not in metafunc.fixturenames or "daemon" in metafunc.fixturenames: return if not list(metafunc.definition.iter_markers("no_daemon")): - protocols = [None, "legacy-combined", "legacy"] - # do not enable them the protocols for now - # protocols += daemon_protocols # noqa ERA001 + protocols = [None, *daemon_protocols] ids = protocols metafunc.parametrize("nix", protocols, indirect=True, ids=ids)