Files
lix/tests/functional2/cli/test_daemon.py
T
eldritch horrors f5b9f105e2 libstore: drop Store::connect
there's no reason a store should not open a connection during init if it
needs to open any connection to function. delaying connection setup like
this makes openStore less deterministic and graceful fallback impossible

this caused test failures where the old behaviour was required to ensure
test output stability. because of course something like that must happen

Change-Id: I946adddee026f1f4c74b4699d730b4d1ac9a5072
2026-07-17 18:00:14 +00:00

30 lines
1.2 KiB
Python

from pathlib import Path
from testlib.fixtures.nix import Nix
from testlib.fixtures.file_helper import with_files
from testlib.utils import get_global_asset_pack
import pytest
pytestmark = pytest.mark.no_daemon
@with_files(get_global_asset_pack("simple-drv"))
def test_stdio_forward_failure(nix: Nix, files: Path):
result = (
nix.nix_build(
[
f"{files}/simple.nix",
"--builders",
# build-remote handles the first ssh-ng in-process, but we want to test how nix-daemon
# behaves in error cases. we need to explicitly set remote-program for the main remote
# connection since we may choose the wrong binary otherwise. the inner ssh-ng also has
# a remote-program set to cause predictable failures (rather than using ssh impurely).
f"ssh-ng://localhost?remote-program={nix.env.dirs.nix_bin_dir}/nix-daemon&remote-store=ssh-ng://localhost?remote-program=false",
"-j0",
]
)
.run()
.expect(1)
)
assert "cannot open connection to remote store" in result.stderr_plain
assert "Lix crashed" not in result.stderr_plain