Speed up high-impact functional tests and replace slow ones with unit tests - #7997
Speed up high-impact functional tests and replace slow ones with unit tests#7997gerrod3 wants to merge 14 commits into
Conversation
The functional test waits on the worker heartbeat cleanup interval, so keep it long_running for e2e/nightly and cover the cleanup path with a fast unit test for routine CI. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
The functional test slept 60s and queued 25 tasks. Cover FETCH_TASK_LIMIT doubling in fetch_task without a live worker. Assisted-By: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Use a smaller page size so fewer versions are needed, and create content with the synchronous upload API instead of task-backed creates. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Pre-create content units so create tasks can overlap before the serial modify and publish steps that assert distributed versions are retained. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Dispatch content creates concurrently and use synchronous uploads, cutting setup time for repo-version tests. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Create units with the synchronous upload API and fetch Content-Type headers concurrently on one HTTP session. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Pre-create content with synchronous uploads, wait for checkpoint timestamps only when needed, and run the class serially so xdist does not rebuild five publications per test. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Keep two checkpoints and retain_checkpoints=1, and skip creating an unused distribution. Assisted-By: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Create two visible and two hidden distributions instead of five each; that still covers index visibility without ten serial create tasks. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Group consumers of import_export_repositories into a serial class with class-scoped fixtures so the two immediate syncs run once. Keep light import-check tests and self-contained cases parallel. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Use a serial class with class-scoped three-repo sync and exporter fixtures so xdist does not redo the expensive setup for each export consumer. Assisted-By: Cursor Grok 4.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Skip unused same-domain syncs and keep one uploaded file where a version or last_export is needed for the 400 cases. Assisted-By: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Skip unused same-domain syncs and successful exports; keep one uploaded file where a version or last_export is needed for the 400 cases. Assisted-By: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Populate upstreams with one uploaded file instead of 3-file fixture syncs, and use fewer distributions where label/policy coverage remains. Assisted-By: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Is this officially replacing #7968? If so can that PR be closed? |
Yes, once I'm done comparing the final times and ensuring the most impactful have been extracted, I'll close the old one. |
|
The speedup is kind of insane, a sub-20 azure run... Not sure if I just got lucky with the runner, but here's the explanation from AI: CI is faster because the old tests were paying for setup over and over, not because the assertions got cheaper. On
Job wall clock: pulp 21 → 16 min, azure 26 → 18 min, s3 25 → 21 min. Azure dropped more because that matrix runs domains, where the replication suite was the biggest local win (~353s → ~226s). Three mechanisms show up in the logs: 1. Stop repeating expensive setup under xdist. 2. Skip the task round-trip for content create. 3. Do less work that the assertion does not need. The isolated benches understated CI impact: a single |
Summary
Test plan
oci-env test -p pulpcore unit -- -k "test_missing_worker_cleanup_fails_abandoned_task or test_fetch_task_beyond_initial_batch"oci-env test -p pulpcore functional -- -k "TestPulpImport or test_repo_version_pagination or TestCheckpointDistribution or test_checkpoint_retention or test_hidden_distros"oci-env test -p pulp_file functional -- -k "test_content_types or TestSyncedRepoExport or test_fsexport_cross_domain"PULP_DOMAIN_ENABLED=TrueMade with Cursor