From 7642eee80b4b809ed8db76e64baec1300e0283d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EB=93=9C=EB=A1=9C=20=28Jethro=20Lee=29?= Date: Sat, 26 Oct 2024 00:28:01 +0900 Subject: [PATCH] test --- .github/workflows/main.yml | 27 +++++++++++++++++++++------ action.yml | 2 +- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0daff8b..05108ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,35 +19,50 @@ jobs: echo "I am protected!" sleep 5 + two_clients_test_setup: + runs-on: ubuntu-latest + name: Set up two clients test + needs: [simple_test] + steps: + - uses: actions/checkout@v3 + - name: Plant faulty lock (step 1) + run: | + # Prevent dequeue + sed -i "/^ post-entrypoint:/d" ./action.yml + - name: Plant faulty lock (step 2) + uses: ./ + with: + branch: gh-mutex-two-clients-test + two_clients_test_client_1: runs-on: ubuntu-latest name: Two clients test (client 1) - needs: [simple_test] + needs: [two_clients_test_setup] steps: - uses: actions/checkout@v3 - name: Set up mutex uses: ./ with: branch: gh-mutex-two-clients-test - force-unlock-timeout: 20 + force-unlock-timeout: 21 - run: | echo "I am protected! (Client 1)" - sleep 50 + sleep 20 two_clients_test_client_2: runs-on: ubuntu-latest name: Two clients test (client 2) - needs: [simple_test] + needs: [two_clients_test_setup] steps: - uses: actions/checkout@v3 - name: Set up mutex uses: ./ with: branch: gh-mutex-two-clients-test - force-unlock-timeout: 20 + force-unlock-timeout: 21 - run: | echo "I am protected! (Client 2)" - sleep 50 + sleep 20 debug_test: runs-on: ubuntu-latest diff --git a/action.yml b/action.yml index 344206d..83828c3 100644 --- a/action.yml +++ b/action.yml @@ -22,7 +22,7 @@ inputs: required: false default: 'gh-mutex' force-unlock-timeout: - description: 'The time in seconds after which the lock is forcefully unlocked' + description: 'The time in seconds after which the queue is forcibly unlocked. If set, should be longer than the max expected run time of the jobs.' required: false default: '' debug: