eddiewebb/circleci-queue

[semver:patch] if job is alone, command queue/until_front_of_line doesn't stop

salahalaoui opened this issue · 1 comments

Orb version

3.1.1

What happened

testing on a pipeline, here is the output of the command queue/until_front_of_line



Only blocking execution if running previous jobs matching this job: [doctrine-production] Apply (permanent) 
API Call for existing jobs returned no matches. This means job is alone.
This Job's Pipeline #: 394
Front of Queue (fifo) Pipeline #: 
This build (2248), pipeline (394) is queued, waiting for build(null) pipeline () to complete.
Total Queue time: 583 seconds.
Only blocking execution if running previous jobs on branch: test
Getting queue ordering
Workflow: 32b21a98-2f76-4379-89b4-ffd3e9faed5e is from pipeline #394
Workflow: fa87eb26-f532-436d-98cf-7322f1076ea1 is from pipeline #394
Orb parameter block-workflow is false. Use Job level queueing.
Only blocking execution if running previous jobs matching this job: [doctrine-production] Apply (permanent) 
API Call for existing jobs returned no matches. This means job is alone.
This Job's Pipeline #: 394
Front of Queue (fifo) Pipeline #: 
This build (2248), pipeline (394) is queued, waiting for build(null) pipeline () to complete.
Total Queue time: 594 seconds.
Only blocking execution if running previous jobs on branch: test
Getting queue ordering
Workflow: 32b21a98-2f76-4379-89b4-ffd3e9faed5e is from pipeline #394
Workflow: fa87eb26-f532-436d-98cf-7322f1076ea1 is from pipeline #394
Orb parameter block-workflow is false. Use Job level queueing.
Only blocking execution if running previous jobs matching this job: [doctrine-production] Apply (permanent) 
API Call for existing jobs returned no matches. This means job is alone.
This Job's Pipeline #: 394
Front of Queue (fifo) Pipeline #: 
This build (2248), pipeline (394) is queued, waiting for build(null) pipeline () to complete.
Total Queue time: 605 seconds.
Max wait time exceeded, fail or force cancel...
Cancelling build 2248

Exited with code exit status 1

Expected behavior

since i'm alone on the pipeline, i'm excepting te command to end successfully as soon as the command detect there is no one on the queue, however the command loop for 12 minutes until max wait time exceeded

i think the issue is here

https://github.com/eddiewebb/circleci-queue/blob/main/scripts/loop.bash#L121

the exit 1 should happen after the condition on the debug