Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Test the deadline and the site guard, not the machine

e48543eec150817b20c17a8b3d4f663be1c11609 · Keenan Nemetz · 23d ago · parent c284cb2c

Test the deadline and the site guard, not the machine

verify failed twice on cli-help-table while the runner host was at 50-60% CPU
steal. Neither failing test was about the code under test.

TestWorkflowRefusesAStaleSiteDeploy started its held runner with
exec.Command(binPath, "runner", ...) instead of f.runnerCmd, so it kept the 2G
disk reserve that c284cb2 turned off for every other test-spawned runner. Inside
a CI job /tmp is the runtime's 1G tmpfs, so the nested runner stopped the build
at its first one-second disk check: the stale run failed, but for the disk rather
than for staleness, and the log never said "the site was not deployed".
TestTestRunnersComeFromRunnerCmd now fails when a test starts a runner directly,
because the mistake is invisible on a workstation where /tmp is large.

TestHandshakeDeadlineIsClearedForTheSession gave the handshake a 100 ms deadline
and then slept past it. On a loaded machine the server cut the test's own
handshake, so dial failed with EOF and the test reported a product problem it had
created. It now reads the deadlines the server set on the connection: a non-zero
bound for the handshake, then a zero one after it. That is the property, it takes
no wall-clock assumption, and deleting the clearing in serveConn fails it
immediately instead of a third of a second later.

Closes: 01M7389DZ8JY77W3AF1P10ZDRT

server/integration_test.go +25

@@ -3539,6 +3539,31 @@ func (f *fixture) runnerCmd(t *testing.T, args ...string) *exec.Cmd {
3539 3539 }, args...)...)
3540 3540 }
3541 3541
3542 // TestTestRunnersComeFromRunnerCmd protects the rule runnerCmd documents: a runner
3543 // a test starts directly keeps the 2G disk reserve, and a test's --dir is on /tmp,
3544 // which inside a CI job is the runtime's 1G tmpfs. The reserve then stops every
3545 // nested job at its first one-second check, and the test fails for a reason that has
3546 // nothing to do with what it is testing. It is invisible on a workstation, because
3547 // /tmp is big there.
3548 func TestTestRunnersComeFromRunnerCmd(t *testing.T) {
3549 files, err := filepath.Glob("*_test.go")
3550 if err != nil {
3551 t.Fatal(err)
3552 }
3553 // Split so this test does not find itself.
3554 needle := []byte(`exec.Command(binPath, ` + `"runner"`)
3555 for _, name := range files {
3556 src, err := os.ReadFile(name)
3557 if err != nil {
3558 t.Fatal(err)
3559 }
3560 if bytes.Contains(src, needle) {
3561 t.Errorf("%s starts a runner with exec.Command instead of f.runnerCmd, "+
3562 "so it keeps the disk reserve a CI job's /tmp cannot meet", name)
3563 }
3564 }
3565 }
3566
3542 3567 // runOnce executes one queued job with a real agent.
3543 3568 func (f *fixture) runOnce(t *testing.T) { f.runOnceAs(t, f.keyPath) }
3544 3569