OCA / queue

Asynchronous Job Queue
GNU Affero General Public License v3.0
179 stars 456 forks source link

[16][queue_job] JobsTrap perform_enqueued_jobs not working with jobs creating new jobs #651

Closed fdegrave closed 4 months ago

fdegrave commented 4 months ago

Module

queue_job testing utilities

Describe the bug

After a call to perform_enqueued_jobs the enqueued_jobs is empty, even if one of the jobs created new jobs.

To Reproduce

Affected versions: tested on 16

Steps to reproduce the behavior:

  1. Create a job that creates new jobs
  2. Within a job trap context, create such a job then execute it using trap.perform_enqueued_jobs
  3. trap.enqueued_jobs is empty, but the newly created jobs appear in trap.calls

Expected behavior trap.enqueued_jobs contains the newly created jobs

Note: this is an easy fix, I already tested it. This bug report is for reference in the PR I'll create shortly.