File: weekly-state-locks.yaml

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (84 lines) | stat: -rw-r--r-- 2,665 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: State Locks Checker

on:
  workflow_dispatch:
  schedule:
    - cron: '30 4 * * 0'

jobs:
  run-spread-tests:
    uses: ./.github/workflows/spread-tests.yaml
    name: "spread ${{ matrix.group }}"
    with:
      runs-on: '["self-hosted", "spread-enabled"]'
      group: ${{ matrix.group }}
      backend: ${{ matrix.backend }}
      systems: ${{ matrix.systems }}
      tasks: ${{ matrix.tasks }}
      rules: ${{ matrix.rules }}
      use-snapd-snap-from-master: true
      spread-env: "SPREAD_SNAPD_STATE_LOCK_TRACE_THRESHOLD_MS=1000"
      upload-artifacts: true
    strategy:
      fail-fast: false
      matrix:
        include:
          - group: "ubuntu-24.04"
            backend: "openstack-ps7"
            systems: "ubuntu-24.04-64"
            tasks: "tests/main/"
            rules: "main"
          - group: "ubuntu-core-24"
            backend: "openstack-ps7"
            systems: "ubuntu-core-24-64"
            tasks: "tests/core/"
            rules: "main"

  create-reports:
    runs-on: ubuntu-latest
    needs: [run-spread-tests]
    if: always()
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Get generated data
        uses: actions/download-artifact@v4
        with:
          path: state-locks-artifacts
          pattern: spread-artifacts-*
          merge-multiple: true

      - name: Prepare artifacts
        run: |
          mkdir workdir
          for file in "state-locks-artifacts"/*; do
            tar -xzf "$file" -C workdir
          done

      - name: Get the baseline traces file
        run: |
          curl -s https://storage.googleapis.com/snapd-spread-tests/snapd-tests/ci/state_locks_baseline.traces > state_locks_baseline.traces

      - name: Generate report
        run: |
          find ./workdir/spread-artifacts/state-locks -name snapd_lock_traces -exec cat {} ';' > state_locks.log
          ./tests/utils/state-locks/filter.py -f state_locks.log --list-traces > state_locks.traces
          tar -czf "state-locks-${{ github.run_id }}.tar.gz" state_locks.log

      - name: Generate diff
        run: |
          ./tests/utils/state-locks/traces_diff.py -b state_locks_baseline.traces -f state_locks.traces > diff.traces
          if [ -z "$(cat diff.traces)" ]; then
            echo "No new traces found in state locks file"
          else
            echo "New traces found in state locks file:"
            cat diff.traces
            exit 1
          fi

      - name: Upload state locks data
        uses: actions/upload-artifact@v4
        with:
          name: "state-locks-${{ github.run_id }}"
          path: "state-locks-${{ github.run_id }}.tar.gz"