Next job in the stages is not getting triggered automatically

Next Job in the stages not getting triggered automatically. However if I cancel the job and re-trigger it runs as expected.

Description of the issue:

I have gitlab-ci.yml file which has two jobs build and test running sequentially.

stages:
  - build
  - test

workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

variables:
   image_name: $CI_REGISTRY_IMAGE
Build:
  stage: build
  ... # rest of the contents
  after_script:
     docker push $image_name

Tests:
  stage: test
  image: $image_name
  script:
    - make test
    coverage: '/TOTAL.*\s+(\d+%)$/'
  artifacts:
    paths:
      - project/var/coverage
    expire_in: 1 week
    reports:
      coverage_report:
        coverage_format: cobertura
        path: project/var/coverage/index.html

  • What are you seeing, and how does that differ from what you expect to see?
    I see first job build is getting triggered and is successful and test job is not getting triggered and it says “Job has not been triggered yet” even 1 hour after first job succeeds.
    However if I cancel the job and retry it works as expected.

  • What version are you on? Are you using self-managed or GitLab.com?
    • GitLab (Hint: /help): 15.8 , self-hosted

This is not consistently happening i;e; sometimes it executes both without manual retry.

Please help me to resolve this issue.

1 Like