|
| 1 | +name: Scratch load runs |
| 2 | + |
| 3 | +# Throwaway: 30 runs of the Stop/Quit, Podman fixture and Recorder tests under CPU load, on the |
| 4 | +# branch's head. Lives on a scratch branch only. |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [scratch/flake-public-tests-load2] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +env: |
| 13 | + OPENBOT_DISTRIBUTION_ID: ${{ github.repository }} |
| 14 | + OPENBOT_RELEASE_REPOSITORY: ${{ github.repository }} |
| 15 | + OPENBOT_RELEASE_CHANNEL: stable |
| 16 | + |
| 17 | +jobs: |
| 18 | + load: |
| 19 | + name: load (${{ matrix.part }}) |
| 20 | + runs-on: ubuntu-latest |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + part: [1, 2, 3, 4, 5, 6] |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 27 | + with: |
| 28 | + fetch-depth: 0 |
| 29 | + persist-credentials: false |
| 30 | + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 |
| 31 | + with: |
| 32 | + bun-version: 1.4.3 |
| 33 | + - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 |
| 34 | + with: |
| 35 | + toolchain: stable |
| 36 | + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 |
| 37 | + with: |
| 38 | + workspaces: desktop/src-tauri |
| 39 | + key: scratch-load-head |
| 40 | + - run: | |
| 41 | + sudo apt-get update -qq |
| 42 | + sudo apt-get install -y -qq libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf stress-ng |
| 43 | + - run: bun install --frozen-lockfile |
| 44 | + - run: bun install --frozen-lockfile |
| 45 | + working-directory: desktop |
| 46 | + - run: bun scripts/desktop-version.ts internal |
| 47 | + working-directory: desktop |
| 48 | + - run: bun run build |
| 49 | + working-directory: desktop |
| 50 | + - run: cargo test --locked --lib --bins --no-run |
| 51 | + working-directory: desktop/src-tauri |
| 52 | + - name: Five runs under load |
| 53 | + shell: bash |
| 54 | + run: | |
| 55 | + set +e |
| 56 | + stress-ng --cpu "$(nproc)" --timeout 0 > /dev/null 2>&1 & |
| 57 | + stress=$! |
| 58 | + for i in 1 2 3 4 5; do |
| 59 | + run="head-${{ matrix.part }}-$i" |
| 60 | + (cd desktop/src-tauri && cargo test --locked --bin openbot-desktop > "$RUNNER_TEMP/bin-$i.log" 2>&1) |
| 61 | + bin=$? |
| 62 | + (cd desktop/src-tauri && cargo test --locked --lib -- local_eval:: > "$RUNNER_TEMP/lib-$i.log" 2>&1) |
| 63 | + lib=$? |
| 64 | + (cd extension && bun test tests/connection.test.ts tests/install-setup.test.ts tests/launcher.test.ts > "$RUNNER_TEMP/ext-$i.log" 2>&1) |
| 65 | + ext=$? |
| 66 | + failed=$(grep -hE "^test .* FAILED$|^\(fail\)" "$RUNNER_TEMP/bin-$i.log" "$RUNNER_TEMP/lib-$i.log" "$RUNNER_TEMP/ext-$i.log" | sort -u | tr '\n' ' ') |
| 67 | + echo "RUN $run bin=$bin lib=$lib ext=$ext FAILED: $failed" |
| 68 | + grep -hE -A12 "panicked at|^error|Matcher error" "$RUNNER_TEMP/bin-$i.log" "$RUNNER_TEMP/lib-$i.log" "$RUNNER_TEMP/ext-$i.log" | head -80 | sed "s/^/DETAIL $run /" |
| 69 | + for t in two_stops_at_once a_stop_during_quit quit_during_a_stop quit_reports_a_created_stack runtime_affinity_podman_quit runtime_affinity_podman_stop stop_and_quit_choose; do |
| 70 | + grep -hE "^test tests::.*$t.* \.\.\. (ok|FAILED)$" "$RUNNER_TEMP/bin-$i.log" | sed "s/^/CASE $run /" |
| 71 | + done |
| 72 | + grep -hE "a_stop_never_cancels.* \.\.\. (ok|FAILED)$" "$RUNNER_TEMP/lib-$i.log" | sed "s/^/CASE $run /" |
| 73 | + grep -hE "^\((pass|fail)\) (a fresh install creates its secret|Stop leaves the recording it ended)" "$RUNNER_TEMP/ext-$i.log" | sed "s/^/CASE $run /" |
| 74 | + done |
| 75 | + kill "$stress" |
0 commit comments