Repository navigation
test(fix): the autocollect liveness probe must not double the context path - #800
Merged
Merged
Conversation
…t path Cypress appends a relative request URL to baseUrl, and baseUrl already carries the servlet context path. Prefixing JAHIA_CONTEXT produced /custom-context/custom-context/files/live/... on the SN-custom-context matrix entry, which no servlet matches, so URL rewriting routed it to the render servlet and it answered 400 Unknown locale.
🦜 ChachalogNo changelog entries detected. Learn more about Chachalog. Create a new entry online or run |
commit: |
baptistegrimaud
marked this pull request as ready for review
September 22, 2026 07:37
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.
Closes #795.
Summary
cacheDependencyAutocollectTestbuilds its live-file liveness probe with an explicitJAHIA_CONTEXTprefix. Cypress appends a relative request URL tobaseUrl, andbaseUrlalready carries the servlet context path, so the prefix is applied twice. Dropping it fixes the request.Why
The
SN-custom-contextnightly matrix entry has failed on this test every night since #783 landed, while the plainSNentry passes. Both jobs report to the same dedup key on #795, so the issue alternates between reopened and closed and reads as a flaky test. It is not flaky: it is a deterministic failure on one matrix entry.tests/cypress/plugins/env.jssetsconfig.baseUrl = process.env.JAHIA_URL, andtests/docker-compose.ymlsetsJAHIA_URL=http://jahia:8080${CONTEXT_PATH}. On the custom-context entry that makesbaseUrlhttp://jahia:8080/custom-context, andJAHIA_CONTEXTresolves to/custom-contextfrom the same variable. The probe therefore requested/custom-context/custom-context/files/live/sites/javascriptTestSite/files/autocollected-renamed.jpg. No servlet matches that path, so Jahia's URL rewriting routed it to the render servlet, which readcustom-contextas the locale and answered400 Bad Request — Unknown locale. The Jahia log of run 35672431011 shows the doubled path directly:The error the CI reporter surfaced is the second Cypress attempt, not this one:
before()does not re-run on a retry, so attempt 2 started with the rename already applied and failed on the first assertion instead. That is why the failure looked like a cache-flush bug.Every other use of
JAHIA_CONTEXTin the suite asserts against rendered markup, where the context legitimately appears. This was the only place it was used to build a request URL.Changes
tests/cypress/e2e/ui/cacheDependencyAutocollectTest.cy.ts: request the liveness probe with a relative URL and letbaseUrlsupply the context path; drop the now-unusedJAHIA_CONTEXTimport, and note why the prefix must not come back.Validation
The nightly
SN-custom-contextmatrix entry is what exercises this; the plainSNentry cannot reproduce it, because there the context path is empty and the doubled prefix is invisible. Verified against the CI artifacts of runs 35548225994 and 35672431011, which both carry the doubled URL inresults/jahia.log. CI on this PR runs the suite in both contexts.Documentation
No documentation change: the fix is confined to one test.
ADR
None.
Notes
No changelog fragment: test-only change, no user-visible impact.
Two follow-ups this PR deliberately leaves alone, so the fix stays one line:
before()does not re-run, so a failure in the middle of the test leaves the rename in place and the retry reports a misleading assertion. That is why this failure was mis-read for several nights..should("eq", 200)aftercy.requestreads as a retry that does not exist, since.shouldcannot re-issuecy.request. It is harmless here, becausefailOnStatusCodealready fails the test on a non-2xx.Relates to #795.