Skip to content

CI: Bazel output base lock contention causing ast10x0_qemu_tests to fail #430

Description

@chrysh

Problem

The CI workflow is failing during the ast10x0_qemu_tests build step due to Bazel output base lock contention.

Error Messages

Another command (pid=1964907 (for shutdown)) is running. Waiting for it to complete on the server (server_pid=1964965)...
Another command holds the output base lock:
[2/3] Finished ===> Recipe: build ast10x0_qemu_tests (FAIL)

Root Cause

Multiple Bazel commands are competing for the same output base, either running concurrently or sequentially without proper cleanup. This causes lock contention and build failures.

Job Reference

Proposed Solutions

Option 1: Add explicit output base directories (Recommended)

Isolate Bazel output bases for each job by setting TEST_TMPDIR and explicitly cleaning Bazel state:

jobs:
  test:
    name: Test
    needs: presubmit
    runs-on: openprot-ci-runner
    env:
      TEST_TMPDIR: /tmp/bazel-test-${{ github.run_id }}
    steps:
    - uses: actions/checkout@v7

    - name: Setup Bazel
      uses: bazel-contrib/setup-bazel@0.19.0
      with:
        bazelisk-cache: false
        disk-cache: false
        repository-cache: false

    - name: Clean Bazel
      run: ./pw bazel clean --expunge

    - name: Run tests
      run: ./pw ci

Option 2: Add explicit shutdown between steps

Ensure Bazel server is properly shut down to release locks:

- name: Run tests
  run: |
    bazel shutdown
    ./pw ci
    bazel shutdown

Option 3: Add retry logic

If the issue is transient, implement a retry mechanism:

- name: Run tests
  run: |
    for i in {1..3}; do
      ./pw ci && break || sleep 30
    done

Recommendation

Implement Option 1 first, as it provides isolation between jobs and prevents lock contention at the source.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions