Skip to content

test(e2e): fix race in pdf file render test - #38380

Merged
silverwind merged 3 commits into
go-gitea:mainfrom
silverwind:fix-pdf-e2e-race
Jul 9, 2026
Merged

silverwind merged 3 commits into
go-gitea:mainfrom
silverwind:fix-pdf-e2e-race

Conversation

@silverwind

Copy link
Copy Markdown
Member

data-render-name is set before the plugin's async render runs, so measuring the container height right after the attribute appears can observe the pre-render 48px height when the pdfobject chunk loads slowly (flaked in CI). Poll for the height instead, like the asciicast test in the same file does.

data-render-name is set before the plugin's async render runs, so
measuring the container height right after the attribute appears can
observe the pre-render 48px height when the pdfobject chunk loads
slowly. Poll for the height instead, like the asciicast test does.

Assisted-by: Claude Code:Fable-5
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 9, 2026
@silverwind
silverwind requested a review from Copilot July 9, 2026 12:36
@silverwind silverwind added the backport/v1.27 This PR should be backported to Gitea 1.27 label Jul 9, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 9, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 9, 2026
Comment thread tests/e2e/file-view-render.test.ts Outdated
Signed-off-by: silverwind <me@silverwind.io>
@silverwind
silverwind enabled auto-merge (squash) July 9, 2026 12:46
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Stabilizes the PDF file-view E2E test by removing a race where height was asserted immediately after a render attribute appeared, sometimes observing a pre-render height in CI.

Changes:

  • Replaces a one-time boundingBox().height assertion with a polling assertion to wait for the rendered height.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/file-view-render.test.ts Outdated
Comment thread tests/e2e/file-view-render.test.ts Outdated
@silverwind
silverwind merged commit 7fd34ff into go-gitea:main Jul 9, 2026
23 of 24 checks passed
@silverwind
silverwind deleted the fix-pdf-e2e-race branch July 9, 2026 13:25
@GiteaBot GiteaBot added this to the 28.0.0 milestone Jul 9, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 9, 2026
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jul 9, 2026
bircni pushed a commit that referenced this pull request Jul 9, 2026
Backport #38380 by @silverwind

`data-render-name` is set before the plugin's async render runs, so
measuring the container height right after the attribute appears can
observe the pre-render 48px height when the `pdfobject` chunk loads
slowly (flaked in CI). Poll for the height instead, like the asciicast
test in the same file does.

Co-authored-by: silverwind <me@silverwind.io>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 9, 2026
* 'main' of https://github.com/go-gitea/gitea: (28 commits)
  enhance(actions): only create filtered-out workflow commit status for required contexts (go-gitea#38371)
  fix(ui): restore commits table column widths (go-gitea#38379)
  test(e2e): fix race in pdf file render test (go-gitea#38380)
  refactor: introduce ActivePageTimer to help to do partial page refresh (go-gitea#38372)
  [skip ci] Updated translations via Crowdin
  chore(typo): fix grammar in comments, API docs and error messages (go-gitea#38370)
  fix: golang html template url escaping (go-gitea#38363)
  perf(actions): debounce runner heartbeat writes and throttle task picks (go-gitea#38281)
  fix(mirror): disable HTTP redirects on pull mirror sync (go-gitea#38320)
  chore(deps): update dependency djlint to v1.40.1 (go-gitea#38354)
  fix(deps): update npm dependencies (go-gitea#38352)
  chore(deps): update action dependencies (go-gitea#38353)
  fix(deps): update go dependencies (go-gitea#38346)
  fix: minio init check (go-gitea#38355)
  fix(pulls): add `branch-name` option for `DEFAULT_TITLE_SOURCE` (go-gitea#38356)
  fix: org project view assignee list (go-gitea#38357)
  feat(webhook): add reviewer name to MS Teams review request notifications (go-gitea#38289)
  chore(deps): update action dependencies (go-gitea#38340)
  chore: Upgrade xorm to 1.4.1 (go-gitea#38224)
  chore(deps): update tool dependencies (go-gitea#38344)
  ...
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 9, 2026
* main:
  enhance(actions): only create filtered-out workflow commit status for required contexts (go-gitea#38371)
  fix(ui): restore commits table column widths (go-gitea#38379)
  test(e2e): fix race in pdf file render test (go-gitea#38380)
  refactor: introduce ActivePageTimer to help to do partial page refresh (go-gitea#38372)
  [skip ci] Updated translations via Crowdin
  chore(typo): fix grammar in comments, API docs and error messages (go-gitea#38370)
  fix: golang html template url escaping (go-gitea#38363)
  perf(actions): debounce runner heartbeat writes and throttle task picks (go-gitea#38281)
  fix(mirror): disable HTTP redirects on pull mirror sync (go-gitea#38320)
  chore(deps): update dependency djlint to v1.40.1 (go-gitea#38354)
  fix(deps): update npm dependencies (go-gitea#38352)
  chore(deps): update action dependencies (go-gitea#38353)
  fix(deps): update go dependencies (go-gitea#38346)
  fix: minio init check (go-gitea#38355)
  fix(pulls): add `branch-name` option for `DEFAULT_TITLE_SOURCE` (go-gitea#38356)
zeekay pushed a commit to hanzoai/forge that referenced this pull request Jul 26, 2026
`data-render-name` is set before the plugin's async render runs, so
measuring the container height right after the attribute appears can
observe the pre-render 48px height when the `pdfobject` chunk loads
slowly (flaked in CI). Poll for the height instead, like the asciicast
test in the same file does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/done All backports for this PR have been created backport/v1.27 This PR should be backported to Gitea 1.27 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants