From 21e08b0bb52af44046cce546c4e4a4a86810e375 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Thu, 23 Apr 2026 16:24:40 -0700 Subject: [PATCH] [Infra] Run schema-migration shard serially (workers: 0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_db_schema_migration.py has exactly one test, and that test is mostly waiting on prisma subprocesses (~170s: prisma migrate deploy + prisma migrate diff). No CPU-bound Python work inside the test body, and only one test in the file means xdist's parallelism is unused regardless. Previous run on commit 5df9f397e6: 10.0m wall-clock for the shard, of which 4:56 was silence between step start and pytest banner — the cost of 4 xdist workers each cold-starting (pytest plugin load + litellm import + pytest-cov instrumentation) so that exactly one of them could pick up the single test. Switching to workers: 0 takes the serial pytest branch in the base workflow, which already handles this case correctly (no -n, no --dist). Single-process startup instead of 4. Expected wall-clock: ~6m. --- .github/workflows/test-unit-proxy-db.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-unit-proxy-db.yml b/.github/workflows/test-unit-proxy-db.yml index b9496e39a30..14010d896b5 100644 --- a/.github/workflows/test-unit-proxy-db.yml +++ b/.github/workflows/test-unit-proxy-db.yml @@ -164,13 +164,15 @@ jobs: timeout: 15 # ---- db-and-spend: isolate the 170s schema-migration test ---- - # test_db_schema_migration.py has one test that runs ~170s; it - # single-handedly pins one xdist worker and determined the whole - # shard's 12.3m wall-clock. Isolated here so the other 45 tests - # finish faster. + # test_db_schema_migration.py has exactly one test, and that test + # is mostly waiting on `prisma migrate deploy` / `prisma migrate + # diff` subprocesses (~170s). It does no CPU-bound Python work + # inside the test. Running with workers=0 (serial, no xdist) + # skips the 4-worker cold-start cost we'd otherwise pay for a + # single test, saving ~4 minutes of wall-clock. - test-group: schema-migration test-path: "tests/proxy_unit_tests/test_db_schema_migration.py" - workers: 4 + workers: 0 dist: loadscope timeout: 15 - test-group: db-and-spend