Repository navigation
test(e2e): Run live delivery specs in parallel - #1331
Closed
utkarshcloudinary wants to merge 1 commit into
Closed
utkarshcloudinary wants to merge 1 commit into
utkarshcloudinary wants to merge 1 commit into
Conversation
Five specs were tagged @serial only because they need the real Cloudinary connection, which the analytics specs overwrite with fake credentials. They do not break each other, so run them in their own multi-worker pass, tagged @LiVe, between the analytics pass and the serial pass. They share one site, so the steps that act on site-wide state take turns through a file lock in tests/e2e/utils/live-site.js: `wp cloudinary sync`, whose analyze step clears and re-adds `_cld_unsynced` on every attachment, the gallery's image_data sync, post cleanup, and settings writes to the shared media_display option.
Collaborator
Author
|
Closing. The CI run showed no gain: the E2E step took 2:53 against 2:33 to 2:48 on develop. The site lock makes the slow sync steps run one at a time, so the @LiVe pass saved only about 6s. It also made asset-edit flaky, because the SVG spec changes image_format/image_quality while asset-edit compares full delivery URLs. A better next step is separate WordPress sites per pass (the second wp-env site, or 2 CI runners). |
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.
No issue. CI speed-up, follow-up to #1330.
Approach
The E2E job is the longest CI job, and its single-worker
@serialpass (18 tests, about 1.8 min) is the biggest part. Five of the eight@serialfiles were tagged only because they need the real Cloudinary connection, which every analytics spec overwrites with fake credentials. They do not break each other: they write the same real URL, and each one changes only settings that the others do not check. This PR moves them to a new multi-worker pass.@liveon the image, video, gallery, SVG and asset-edit delivery specs.npm run test:e2enow runs three passes: analytics and other safe specs (3 workers),@live(3 workers), then@serial(1 worker).@serial: deactivation (it uninstalls the plugin), wizard setup, and connection analytics.tests/e2e/utils/live-site.js. It makes the steps that act on site-wide state take turns through a file lock:wp cloudinary sync, because it is not scoped to one attachment. Its analyze step clears and re-adds_cld_unsyncedon every attachment, so two parallel syncs can make one of them find nothing./cloudinary/v1/image_datasync.media_displayoption (SVG settings andvideo_player).mkdirinartifacts/. It records the owner PID, so a worker that dies while holding it does not block the run.I tested the lock alone with 4 processes and 320 lock sections (sync and async callbacks): no overlaps. A lock from a dead PID was taken over at once.
QA notes
npm run test:e2eshould show three Playwright runs: about 20 tests on 3 workers, 9@livetests on 3 workers, and 9@serialtests on 1 worker.developruns (about 2.6 to 2.8 min).npm run test:e2e:live.