Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification for abort-after-seconds #27

Open
ltamrazov opened this issue Nov 21, 2020 · 2 comments
Open

Clarification for abort-after-seconds #27

ltamrazov opened this issue Nov 21, 2020 · 2 comments

Comments

@ltamrazov
Copy link

Hi, I wanted to clarify how this feature works. I tried to do abort-after-seconds: 1 hoping to bail right away if there is already a job in progress, but it seemed to wait much longer ~42 seconds before I canceled the job.

I then though that maybe it needs to work with poll-interval-seconds, and also set that to 1. This time the job resumed although there was already a run in progress so it should have stopped. Screenshot:

Screen Shot 2020-11-21 at 6 44 31 PM

Similarly for the second run that I expected to fail:
Screen Shot 2020-11-21 at 6 46 47 PM

Thank you!

@ltamrazov
Copy link
Author

ltamrazov commented Nov 22, 2020

This is the workflow:

name: release

on:
  pull_request:
    branches: [ master ]

jobs:
  cancel-workflows:
    runs-on: ubuntu-latest
    steps:
      - name: Block concurrent deploys
        uses: softprops/turnstyle@v1
        with:
            abort-after-seconds: 1
            poll-interval-seconds: 1
        env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  
  another-job:
    runs-on: ubuntu-latest
    needs: [cancel-previous-workflows]
    steps:
      - name: sleep
        run: sleep 30

@ltamrazov
Copy link
Author

ltamrazov commented Nov 22, 2020

Further testing seems like it only works when its on the same job like:

jobs:
  cancel-workflows:
    runs-on: ubuntu-latest
    steps:
      - name: Block concurrent deploys
        uses: softprops/turnstyle@v1
        with:
            abort-after-seconds: 1
            poll-interval-seconds: 1
        env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: sleep
        run: sleep 180

Not sure if that's intentional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant