Repository navigation
Conversation
…ey prove About 70 listed api tests spent their time waiting out production timeouts, sweeping cases in sequence or moving megabytes. Each change keeps the outcome the test distinguishes; production keeps today's values. - Test Kubernetes substrate: its reflectors are seeded once and never fed, so every pod-cache miss waited the full 250 ms reflector budget, every delete the 1 s blocking-delete wait, and every joined restore the 2 s restore poll. The reflector wait and the retry-deferral grace move into SubstrateBudgets, the restore poll ceiling into the restore waiters, and the test substrate uses 20 ms, 20 ms and 100 ms. with_seeded_caches keeps production values. - Injectable bounds: the sandbox list page byte budget, the quota lock timeout and the builder connect retry policy. Production passes the existing constants. Tests use KiB pages, a 400 ms quota bound and a 200 ms builder retry. - Real waits: the failover test runs on tokio's paused clock; fixed sleeps that showed a request blocked on a lock now poll for the lock waiter; lock and access timeouts that a test waits out are shorter. - Case sweeps become rstest cases: state rendering (8 snapshot shards whose union is the old snapshot), hidden operations, e2b connect, sessions, owner scope, admin list and id forms, k8s store behaviours (100 tests), lifecycle characterization and others. - File body tests build each multi-MiB body once. Locally the slowest of the changed tests went from 2-16 s to under 1.6 s; all 2,498 api tests pass except the four failover tests that bind 127.0.0.2, which macOS does not allow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
About 70 of the
pplx-space-apitests listed inci/test-duration-budget.tomlget faster. Each one still proves what it proved before, and production keeps today's values. The slow tests fell into four kinds.The test Kubernetes substrate always waited out its budgets. Its reflectors are seeded once and never fed, so in tests:
The reflector wait and the retry-deferral grace move into
SubstrateBudgets, and the restore poll ceiling becomes a field of the restore waiters. The test substrate uses 20 ms, 20 ms and 100 ms.with_seeded_caches, the public test constructor that cluster-controller tests use, keeps production values.Production bounds the tests waited out. These become injectable; production passes the existing constants:
SandboxController.list_page_max_bytes)PublicOperationAdmission.quota_lock_timeout)DirectSubstrate.builder_connect_retry_policy)Real waits in the tests themselves.
pg_stat_activityfor the waiter. The poll helper moved from the quota tests totest_support.rs.Sequential sweeps. These loops become
rstestcases:The file-write tests also build each multi-MiB body once instead of re-encoding it.
routes::e2b::state_render_tests::each_surface_renders_…native_build::a_failed_system_build_frees_its_key_…hidden_operations_answer_as_nonexistent_…updates::postgres_tests::unchanged_timeout_does_not_wait_…characterization_tests::kubernetes::completed_actions_keep_…the_write_body_limit_admits_the_largest_documented_payloadowner_scope_tests::scoped_sandbox_page_bounds_the_bytes_it_returnsrestoring_access::a_joined_restore_that_its_owner_abandons_…These are local times on a loaded machine.
Stack
Validation
cargo clippy -p pplx-space-api --all-targets --all-features -- -D warningsandcargo fmtare clean.native_pod_failovertests: they bind127.0.0.2, which macOS does not allow, and fail the same way without this change.Severity and risk
Severity: does not apply; this is a CI speedup.
Risk:
AI assistance: Claude Code drafted the change, its tests and this description, using parallel agents whose patches it combined.
🤖 Generated with Claude Code