Diffinery

homeflare/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Runner test: don't compare the host's clock speed between two reads

The agent reads /proc/cpuinfo once for the job's runner report and again
for the log line, and on GitHub's hosted runners the MHz moved between
the two (3241 vs 3245), failing CI. Compare the processor and vCPU count.
codician-team authored 1 parent 205b33ecommit 7bbc8b9cf76c33eb2e63d3eed93435a4371776c3Browse files
1 file changed+2−1
modifiedcontainers/runner/test/job.test.ts+2−1View file
@@ -954,7 +954,8 @@
954954 expect(api.logText()).toContain("Runner: image diffinery-runner:abc123, in fra06, EEUR, container d0");
955955 // A hosted runner also names its host's processor and, at the end, the share of its vCPUs' time the host took.
956956 if (existsSync("/proc/cpuinfo")) {
957- expect(api.logText()).toContain(`Host: ${runner.cpu}`);
957+ // The clock speed is read again for the log line, and it moves between reads on a busy host.
958+ expect(api.logText()).toContain(`Host: ${String(runner.cpu).replace(/, \d+ MHz$/, "")}`);
958959 expect(api.logText()).toMatch(/Host: \d+% of the vCPUs' time went to other work on the host \(steal\)/);
959960 }
960961 expect(api.completion).toMatchObject({ conclusion: "failure", failure: { step: 0 } });