|
4 | 4 | inputs = { |
5 | 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
6 | 6 | flake-utils.url = "github:numtide/flake-utils"; |
7 | | - # Runtime compatibility gate: this is the smallest pty revision containing both the |
8 | | - # ambiguity-safe PID read and the single fleet-wide socket fallback budget. |
9 | | - pty.url = "github:compoundingtech/pty/6de78841e05ac5b9f4fbe844a71b6dfcc7c7f9a5"; |
| 7 | + # Runtime compatibility gate: reviewed coherent lifecycle baseline containing the |
| 8 | + # ambiguity-safe PID read, EPERM handling, and single fleet-wide socket fallback budget. |
| 9 | + pty.url = "github:compoundingtech/pty/afeb3b6234b7010b7db802fd029766ad17c14219"; |
10 | 10 | pty.inputs.nixpkgs.follows = "nixpkgs"; |
11 | 11 | }; |
12 | 12 |
|
|
163 | 163 | checks.pty-fleet-contract = pkgs.runCommand "st2-pty-fleet-contract-${version}" { |
164 | 164 | nativeBuildInputs = [ |
165 | 165 | pkgs.coreutils |
| 166 | + pkgs.jq |
| 167 | + pkgs.nodejs |
166 | 168 | pty.packages.${system}.default |
167 | 169 | st2 |
168 | 170 | ]; |
|
174 | 176 | 'agent "gone" { host "contract"; retired #true; command "true" }' \ |
175 | 177 | > "$catalog/agents/contract/gone/agent.kdl" |
176 | 178 |
|
| 179 | + # Run the exact packaged producer's deterministic fault seams. These prove EPERM avoids |
| 180 | + # socket fallback and hundreds of indefinitely-hung ambiguous probes share one deadline. |
| 181 | + test_config=$(mktemp --suffix=.mjs) |
| 182 | + printf '%s\n' 'export default { test: {} }' > "$test_config" |
| 183 | + node \ |
| 184 | + ${pty.packages.${system}.default}/lib/pty/node_modules/vitest/vitest.mjs \ |
| 185 | + run tests/list-liveness-budget.test.ts \ |
| 186 | + --config "$test_config" \ |
| 187 | + --root ${pty.packages.${system}.default}/lib/pty |
| 188 | +
|
177 | 189 | for fleet_size in 0 75 100 500; do |
178 | 190 | root=$(mktemp -d) |
179 | 191 | i=0 |
|
184 | 196 | i=$((i + 1)) |
185 | 197 | done |
186 | 198 |
|
| 199 | + PTY_ROOT="$root" timeout 2s pty list --json > "pty-$fleet_size.json" |
| 200 | + jq -e --argjson size "$fleet_size" \ |
| 201 | + 'length == $size and all(.status == "running")' \ |
| 202 | + "pty-$fleet_size.json" >/dev/null |
| 203 | +
|
187 | 204 | PTY_ROOT="$root" timeout 2s \ |
188 | 205 | st2 doctor --catalog "$catalog" --host contract \ |
189 | 206 | > "doctor-$fleet_size.out" |
190 | | - grep -F 'contract.gone retirement complete' "doctor-$fleet_size.out" >/dev/null |
| 207 | + grep -F 'contract.gone retirement complete' \ |
| 208 | + "doctor-$fleet_size.out" >/dev/null |
191 | 209 | done |
192 | 210 |
|
193 | 211 | touch $out |
|
0 commit comments