Timeout not killing long running task

I’ve had several instances now where my test runner fails on a PR and churns through 360 of my precious minutes before it is killed. I have since added timeout-minutes: 10 to my job declaration, but it’s continuing to happen (running for the full 360 minutes, rather than 10). Am I missing something, or is there something I don’t understand about how this works?

Workflow File:

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
    types:
      - opened
      - reopened
      - synchronize

name: Master

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2

      - name: Use Node.js v12
        uses: actions/setup-node@v1.4.0
        with:
          node-version: 12

      - name: Setup MySQL
        uses: mirromutth/mysql-action@v1.1
        with:
          mysql version: '5.7'
          mysql database: 'test'
          mysql root password: 'password'

      - name: Install
        run: npm ci

      - name: Set ENV
        run: echo "MYSQL_PASS=\"password\"" > .env

      - name: Test
        run: npm test

  release:
    if: github.event_name == 'push' && github.ref == 'refs/heads/master'
    name: Release
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v2

      - name: Use Node.js v12
        uses: actions/setup-node@v1.4.0
        with:
          node-version: 12

      - name: Check if version has been updated 
        id: check
        uses: EndBug/version-check@v1.2.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          diff-search: true

      - name: Push to production
        if: steps.check.outputs.changed == 'true'
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: production
          tags: true
          force: true
      
      - name: Create Release
        if: steps.check.outputs.changed == 'true'
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: v${{ steps.check.outputs.version }}
          release_name: Release v${{ steps.check.outputs.version }}

      - name: Send Notification 
        uses: bayssmekanique/action-simple-slack-notifier@v1
        if: steps.check.outputs.changed == 'true' && always()
        with:
          token: ${{ secrets.SLACK_BOT_TOKEN }}
          status: ${{ job.status }}
          action: Release
          channel: '#deployment'
          version: ${{ steps.check.outputs.version }}

Looks like it’s a single command that runs for hours. Maybe GitHub doesn’t terminate running commands, but only checks if the timeout is exceeded after each command? You should probably open a support ticket.

1 Like