github

Workflow sharing concurrency group cancelled instead of pending


I have two workflows sharing concurrency group:

jobs:
  evaluate:
    runs-on: [ android-emulator ]
    concurrency: evaluation_emulator

and:

jobs:
  other_tests:
    runs-on: [ android-emulator ]
    concurrency: evaluation_emulator

The second job has been cancelled:

Canceling since a higher priority waiting request for 'evaluation_emulator' exists

despite the fact the documentation says default behavior is to put workflow in a pending state, not cancelling:

When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending.

Why this happens?


Solution

  • From what I found in the documentation, the default behavior is to not cancel running job but it will cancel pending jobs:

    the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled.

    From: Workflow syntax for GitHub Actions

    There is a discussion regarding this, the issue doesn't seem to be resolved yet.. Concurrency Cancel Pending