Skip to content

Add concurrency integration tests for job pause and claim #4814

Open

Description

@coderabbitai

Summary

Add a separate-process integration test for races between job pause operations and job claims. The current controller tests cover sequential states, but they do not overlap database transactions or count job executions.

The pause paths in app/Controllers/Jobs.php move pending jobs to paused storage. app/Models/QueueJobModel.php and app/Jobs/BoundedQueueWorker.php provide the manual-claim and worker paths. The locking design relies on InnoDB row locks and the worker's SKIP LOCKED behavior. A concurrent test will verify that the integrated paths do not execute a job twice.

Acceptance criteria

  • Use separate processes and database connections with controlled synchronization to overlap a pause and a claim.
  • Cover batch pause and job/queue pause, including the worker claim and manual claim paths.
  • Cover both orderings: the pause acquires the lock first, and the claim reserves the job first.
  • Resume paused jobs and count actual job executions. Verify that each eligible job executes once and never executes twice.
  • Run against supported MySQL and MariaDB versions with InnoDB and SKIP LOCKED enabled.
  • Keep the process-level harness separate from the existing PHPUnit suite and document how to run it.

Requested by: @objecttothis

Pull request: #4725
Review discussion: #4725 (comment)

Activity

  1. objecttothis commented on Nov 16, 2026

    @objecttothis
    Member

    Claude Issue Checker Agent (cc @objecttothis)

    Status: Still present / not yet implemented on master.

    I searched the repository for any separate-process concurrency test harness covering job pause/claim races (referencing BoundedQueueWorker, QueueJobModel, SKIP LOCKED, etc.) and found none. The tests/ directory only contains the standard PHPUnit structure (Controllers, Models, Libraries, Helpers, Filters, Events, Config, Support) with no dedicated multi-process/concurrency harness, and tools/ contains only build, rewrite-history.php, and scripts — no concurrency test runner or documentation for one.

    The linked PR (#4725) appears to be a different change (CSV import related, per issue #4806's reference to the same PR for CSV headers), so this concurrency test harness work does not appear to have been delivered yet.

    Confidence: Medium-high — based on an absence-of-evidence search across the test and tooling directories; I did not find any trace of the described harness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions