serialize real-pql tests to fix parallel db contention
The pql integration tests (test/pql/client_test.dart) and pql.* daemon handler tests (test/daemon/pql_commands_test.dart) each spawn a real `pql` process against the shared on-disk .pql/pql.db. In the parallel test pool, concurrent invocations contend for the SQLite lock and flake with PqlException(69) (db busy) — surfaced reliably by the pql 1.10 record_id migration. They pass one-at-a-time, so isolation is the fix. Tag both files @Tags(['serial']) and add a --concurrency=1 serial pass to ci/test_core.sh (pty + serial together), mirroring ci/test.sh's existing serial handling. The error-path companion uses a fake binary, so it stays parallel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+14
-9
@@ -48,15 +48,20 @@ run_pass() {
|
||||
fi
|
||||
}
|
||||
|
||||
# PTY-tagged tests spawn real PTYs (posix_openpt + posix_spawn) and rely on a
|
||||
# reader isolate; run in the default parallel pool they contend for fds + CPU
|
||||
# with the other suites and the isolate is starved, flaking 'write sends
|
||||
# keystrokes to child' (T-292). Serialize them in their own pass — matching
|
||||
# ci/test.sh — then run everything else in parallel.
|
||||
echo "test-core: dart test (pty-tagged; --concurrency=1) (timeout ${TIMEOUT_SECONDS}s)"
|
||||
run_pass --concurrency=1 --tags pty $CORE_DIRS
|
||||
# Some core tests must not share the parallel pool:
|
||||
# - pty: spawn real PTYs (posix_openpt + posix_spawn) + a reader isolate;
|
||||
# in the parallel pool they contend for fds + CPU and the isolate starves,
|
||||
# flaking 'write sends keystrokes to child' (T-292).
|
||||
# - serial: spawn real `pql` processes against the shared on-disk
|
||||
# `.pql/pql.db`; concurrent invocations contend for the SQLite lock and
|
||||
# flake with PqlException(69) (db busy). (T-193, surfaced by the pql 1.10
|
||||
# record_id migration.)
|
||||
# Run both in one --concurrency=1 pass (matching ci/test.sh's serial handling),
|
||||
# then everything else in parallel.
|
||||
echo "test-core: dart test (pty + serial; --concurrency=1) (timeout ${TIMEOUT_SECONDS}s)"
|
||||
run_pass --concurrency=1 --tags "pty || serial" $CORE_DIRS
|
||||
|
||||
echo "test-core: dart test (rest; parallel, excludes pty) (timeout ${TIMEOUT_SECONDS}s)"
|
||||
run_pass --exclude-tags pty $CORE_DIRS
|
||||
echo "test-core: dart test (rest; parallel, excludes pty + serial) (timeout ${TIMEOUT_SECONDS}s)"
|
||||
run_pass --exclude-tags "pty || serial" $CORE_DIRS
|
||||
|
||||
echo "test-core: ok"
|
||||
|
||||
Reference in New Issue
Block a user