Skip to content

[v2] Run the job tests without a shell or real-time waits - #282

Draft
ajvb wants to merge 1 commit into
v2-devfrom
job-tests-without-shell
Draft

ajvb wants to merge 1 commit into
v2-devfrom
job-tests-without-shell

Conversation

@ajvb

@ajvb ajvb commented Nov 23, 2026

Copy link
Copy Markdown
Owner
  • Local jobs start their command through a CommandRunner taken from their cache, like the clock.
  • Adds internal/fakecommands, a runner that starts no process. NewMockCache uses it.
  • Tests that slept now advance the fake clock and wait for the job's run. The fake clock counts fired timers, so a test can check a job did not run without waiting.
  • Enable now arms the job's timer before it returns.
  • Fixes a deadlock when a job was deleted from a MemoryJobCache while it ran.

Local jobs start commands through their cache's CommandRunner; tests
use a fake one. Tests that slept now use the fake clock.
Enable arms its timer before returning, and deleting a
running job from a memory cache no longer deadlocks.
@ajvb
ajvb force-pushed the job-tests-without-shell branch from e7d03c0 to 77f7da4 Compare November 23, 2026 04:15
@ajvb
ajvb marked this pull request as draft November 23, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant