Repository navigation
151 lines (145 loc) · 6.2 KB
/
Copy pathrust-nightly.yml
File metadata and controls
151 lines (145 loc) · 6.2 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Rust Nightly
# Long fuzz runs of the Rust client, on seeds the PR checks don't reach. Each
# run takes new seeds from its run number, and a failure names the seed to
# replay: JS's answers to new random queries, pushes and client scenarios,
# compared with Rust's. The seeds are the ones Swift Nightly uses on the same run number.
on:
schedule:
# 3:30 AM US Eastern, after Swift Nightly.
- cron: '30 7 * * *'
workflow_dispatch:
inputs:
first-seed:
description: The seed (the run number when empty)
default: ''
permissions:
contents: read
jobs:
# JS's answers on new seeds, 5 to 10 times the PR checks' cases. The seeds
# are printed, so a mismatch replays with the same environment variables.
differential-vectors:
name: Differential vectors (JS)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11.11.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- run: pnpm install --frozen-lockfile
- name: Generate
working-directory: packages/zero-conformance
env:
SEED: ${{ inputs.first-seed || format('{0}', github.run_number) }}
run: |
base=$((1000000 + SEED))
export IVM_FUZZ_SEED=$base IVM_FUZZ_CASES=6000
export SWEEP_IVM_SEED=$base SWEEP_IVM_CASES=15000
export HARDEN_IVM_SEED=$((base * 10)) HARDEN_IVM_SEEDS=5
export AGG_FUZZ_SEED=$base AGG_FUZZ_CASES=750
# Not seeded: the restored chinook fuzzer's lane, with two-row pushes too.
export RESTORED_CHINOOK_PUSH_ROWS=1,2
env | grep -E '_(SEED|SEEDS|CASES|ROWS)=' | sort
# Five to ten times the cases outlast vitest's 10 s default; the
# job's timeout bounds them.
pnpm exec vitest run --test-timeout=600000 src/ivm/ivm.test.ts src/ivm/ivm-features.test.ts \
src/ivm/sweep-ivm.test.ts src/ivm/harden-ivm.test.ts src/client/bughunt.test.ts \
src/ivm/restored-chinook.test.ts
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: differential-vectors
path: packages/zero-conformance/generated/
if-no-files-found: error
retention-days: 7
differential-rust:
name: Differential vectors (Rust)
needs: differential-vectors
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: differential-vectors
path: packages/zero-conformance/generated/
# rustup is preinstalled; rust-toolchain.toml picks the version.
- name: Install the toolchain
run: rustup show active-toolchain || rustup toolchain install
# Only the IVM corpora, the restored chinook lane and the client
# aggregate scenarios are written, so the others are missing; the report
# still fails on any case that differs from JS. Each runs, so one's
# failure doesn't hide another's.
- name: Compare with JS
run: |
cargo build --locked --release -p zero-conformance
status=0
for filter in ivm restored-chinook client-aggregates; do
cargo run --locked --release -p zero-conformance -- --summary "$GITHUB_STEP_SUMMARY" "$filter" || status=1
done
exit $status
# Random cuts, stalls, outages, Postgres writes and relaunches against
# zero-cache, two clients at a time (`fuzz` in
# zero-client/tests/client_e2e), on the seeds Swift Nightly's chaos fuzz
# takes on the same run number.
chaos-fuzz:
name: Chaos fuzz (Linux)
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11.11.0
# zero-cache runs from source, which needs Node 24 (`using`).
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.x
package-manager-cache: false
- run: pnpm install --frozen-lockfile
- name: Start Postgres
run: |
sudo systemctl start postgresql.service
sudo -u postgres psql -q -c "ALTER SYSTEM SET wal_level = logical" \
-c "ALTER USER postgres PASSWORD 'postgres'"
sudo systemctl restart postgresql.service
until pg_isready -q -h 127.0.0.1; do sleep 1; done
- name: Install the toolchain
working-directory: rust
run: rustup show active-toolchain || rustup toolchain install
- name: Build
working-directory: rust
run: cargo test -p zero-client --features tokio-transport,sqlite-bundled --test client_e2e --locked --no-run
- name: Start zero-cache
env:
ZERO_E2E_PG: postgresql://postgres:postgres@127.0.0.1:5432/postgres
run: |
node packages/zero-conformance/src/e2e/server.ts > "$RUNNER_TEMP/server.log" 2>&1 &
for _ in $(seq 1 120); do
grep -q '^ready ' "$RUNNER_TEMP/server.log" && exit 0
sleep 1
done
cat "$RUNNER_TEMP/server.log"
exit 1
- name: Fuzz
working-directory: rust
env:
ZERO_E2E_URL: ws://127.0.0.1:4848
ZERO_CHAOS_SEEDS: '150'
ZERO_CHAOS_FIRST_SEED: ${{ inputs.first-seed || format('{0}000', github.run_number) }}
run: cargo test -p zero-client --features tokio-transport,sqlite-bundled --test client_e2e --locked fuzz::random_seeds -- --nocapture
- name: zero-cache log
if: failure()
run: cat "$RUNNER_TEMP/server.log"