Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nix/runner/test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ pkgs.testers.runNixOSTest {
# re-reads its inputs from disk until the job times out.
assert elapsed < 60, "the guest thrashed instead of killing memory-hog"
time.sleep(1)
print(guest.succeed("journalctl -u earlyoom | grep -F 'sending SIGTERM to process'"))
# earlyoom sends SIGKILL instead of SIGTERM when its poll first lands
# below the 5% kill threshold, which depends on how fast the hog fills.
print(guest.succeed("journalctl -u earlyoom | grep -E 'sending SIG(TERM|KILL) to process .*${./hog.py}'"))
guest.succeed("rm /var/tmp/hog-inputs")
router.wait_until_succeeds("${pkgs.openssh}/bin/ssh-keyscan -t ed25519 -T 5 10.231.0.2 | grep -F ssh-ed25519", timeout=timedelta(minutes=1))

Expand Down
1 change: 0 additions & 1 deletion quest/m0/test-flakes-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ Public API: none. Wire: none.
- [IETF22 fallback](/quest/m0/test-flakes-2/ietf22-fallback.md) - an IETF22 browser viewer follows a fallback within the media lane's bound, keeping its session and its audio
- [Swapped Rust to JS Opus](/quest/m0/test-flakes-2/swapped-js-opus.md) - the `rust-swapped -> js` interop cell stops timing out under load
- [JS host-task yields follow the clock](/quest/m0/test-flakes-2/js-host-yields.md) - `Budget` and `nextTask` yield through the injected clock, so `Manual` tests stop racing them
- [Runner VM test under load](/quest/m0/test-flakes-2/runner-vm.md) - the runner VM check passes when it rebuilds in a merge group, and a failed flake check prints its full log
29 changes: 0 additions & 29 deletions quest/m0/test-flakes-2/runner-vm.md

This file was deleted.

14 changes: 7 additions & 7 deletions sh/dispatch-query.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_local_flake_namespace_refusal_is_reported_as_skipped(self):
self.assertIn("local Nix builder cannot create user namespaces", result.stdout + result.stderr)
self.assertRegex(result.stderr, r"\d+ check flake \(skipped\)")
calls = (self.root / "calls").read_text().splitlines()
self.assertNotIn("nix flake check", calls)
self.assertNotIn("nix flake check --print-build-logs", calls)
self.assertIn("gh test", calls)
probe, = [call for call in calls if call.startswith("nix build ")]
self.assertIn("--builders --max-jobs 1", probe)
Expand All @@ -297,15 +297,15 @@ def test_local_capable_builder_runs_the_full_flake(self):
self.assertEqual(result.returncode, 0, result.stderr)
self.assertNotIn("(skipped)", result.stderr)
calls = (self.root / "calls").read_text().splitlines()
self.assertIn("nix flake check", calls)
self.assertIn("nix flake check --print-build-logs", calls)
self.assertEqual(sum(call.startswith("nix build ") for call in calls), 1)

@unittest.skipUnless(sys.platform == "linux" and os.uname().machine == "x86_64", "Linux VM checks only")
def test_local_flake_check_exiting_77_fails_instead_of_skipping(self):
self.stub_ci()
self.change("flake.nix")
nix = self.bin / "nix"
nix.write_text(nix.read_text() + 'case "$*" in "flake check") exit 77 ;; esac\n')
nix.write_text(nix.read_text() + 'case "$*" in "flake check --print-build-logs") exit 77 ;; esac\n')
self.env.pop("CI_STRICT")
result = subprocess.run(["bash", "sh/dispatch.sh", "check", "origin/main"], cwd=self.repo,
env=self.env, text=True, capture_output=True)
Expand All @@ -326,13 +326,13 @@ def test_local_flake_probe_errors_are_failures_without_cancelling_other_modules(
self.assertIn("check: check flake failed", result.stderr)
self.assertNotIn("(skipped)", result.stderr)
calls = (self.root / "calls").read_text().splitlines()
self.assertNotIn("nix flake check", calls)
self.assertNotIn("nix flake check --print-build-logs", calls)
self.assertIn("gh test", calls)

def test_strict_ci_runs_the_full_flake_without_a_probe(self):
self.change("flake.nix")
calls = self.run_ci()
self.assertIn("nix flake check", calls)
self.assertIn("nix flake check --print-build-logs", calls)
self.assertFalse(any(call.startswith("nix build ") for call in calls))
nix = self.bin / "nix"
nix.write_text(nix.read_text() + 'exit 77\n')
Expand Down Expand Up @@ -392,8 +392,8 @@ def test_flake_checks_follow_nix_inputs_instead_of_rust_source(self):
self.change(path)
calls = self.run_ci()
(self.repo / path).unlink()
self.assertEqual("nix flake check" in calls, expected)
self.assertIn("nix flake check", self.run_ci("--all"))
self.assertEqual("nix flake check --print-build-logs" in calls, expected)
self.assertIn("nix flake check --print-build-logs", self.run_ci("--all"))


def benchmark():
Expand Down
4 changes: 3 additions & 1 deletion sh/dispatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ step() {
fi
fi
# 77 marks the probe's skip, so the check's own 77 is a failure.
bash sh/local.sh nix flake check || {
# Full build logs name a failing VM subtest; Nix otherwise keeps
# only the last 25 lines, which are QEMU's cleanup.
bash sh/local.sh nix flake check --print-build-logs || {
local status=$?
[[ -n "${CI_STRICT:-}" ]] || ((status != 77)) || status=1
return "$status"
Expand Down
Loading