chore(e2e): refactor "Toggle visibility" org-members test #12871

Merged
Gusted merged 1 commit from 0ko/e2e-org-members-toggl into forgejo 2026-06-02 14:52:16 +02:00 AGit
Owner

This test fails very often in CI. This should hopefully improve it.

With a downclocked CPU I've got 2 errors in 10 tries. After adding

await page.waitForLoadState();

I got no errors in 20 tries. But my testing methodology is unreliable so there's no guarantee that this helps:

  • Locator.click() documentation says that it already waits by default for caused navigation to finish
  • I added some date time measurement and waitForLoadState was clocking in about 5-15 ms, which shouldn't be causing the issue for expect that times out in 3000ms
    ...but e2e issues were element(s) not found on timeout, not wrong state, so my assumption is that somehow it is asserting the wrong snapshot of a page that isn't fully loaded

Additionally, I've converted revertion logic to make consistent before testing, which is better at handling test retries in case that the revertion part of the code was never ran in previous failure. In such case test retry is guaranteed to fail as well, at least when testing locally, not sure about CI.

Additionally, a completely unrelated comment fix in Playwright config.

This test fails very often in CI. This should hopefully improve it. With a downclocked CPU I've got 2 errors in 10 tries. After adding ``` await page.waitForLoadState(); ``` I got no errors in 20 tries. But my testing methodology is unreliable so there's no guarantee that this helps: * `Locator.click()` documentation says that it already waits by default for caused navigation to finish * I added some `date` time measurement and `waitForLoadState` was clocking in about 5-15 ms, which shouldn't be causing the issue for `expect` that times out in 3000ms ...but e2e issues were `element(s) not found` on timeout, not wrong state, so my assumption is that somehow it is asserting the wrong snapshot of a page that isn't fully loaded Additionally, I've converted _revertion_ logic to _make consistent before testing_, which is better at handling test retries in case that the _revertion_ part of the code was never ran in previous failure. In such case test retry is guaranteed to fail as well, at least when testing locally, not sure about CI. Additionally, a completely unrelated comment fix in Playwright config.
chore(e2e): refactor "Toggle visibility" org-members test
Some checks failed
testing / semgrep/ci (pull_request) Successful in 21s
issue-labels / cascade (pull_request_target) Has been skipped
testing / frontend-checks (pull_request) Successful in 1m18s
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Successful in 3s
testing / backend-checks (pull_request) Successful in 3m52s
testing / test-unit (pull_request) Failing after 7m25s
testing / test-remote-cacher (redict) (pull_request) Has been skipped
testing / test-remote-cacher (valkey) (pull_request) Has been skipped
testing / test-remote-cacher (garnet) (pull_request) Has been skipped
testing / test-remote-cacher (redis) (pull_request) Has been skipped
testing / test-e2e (pull_request) Successful in 23m54s
testing / test-mysql (pull_request) Successful in 25m57s
testing / test-sqlite (pull_request) Successful in 32m10s
testing / test-pgsql (pull_request) Successful in 36m15s
testing / security-check (pull_request) Has been skipped
issue-labels / backporting (pull_request_target) Has been skipped
milestone / set (pull_request_target) Successful in 7s
508f3ee237
This should hopefully improve the reliability of this test in CI.

With a downcloced CPU I've got 2 errors in 10 tries. After adding

```
await page.waitForLoadState();
```

I got no errors in 20 tries. But my testing methodology is unreliable so there's no guarantee that this helps:
* `Locator.click()` documentation says that it already waits by default for caused navigation to finish
* I added some `date` time measurement and `waitForLoadState` was clicking in about 5-15 ms, which shouldn't be causing the issue for `expect` that times out in 3000ms
...but e2e issues were `element(s) not found` on timeout, not wrong state, so my assumption is that somehow it is asserting the wrong snapshot of a page that isn't fully loaded

Additionally, I've converted _revertion_ logic to _make consistent before testing_, which is better at handling test retries in case that the _revertion_ part of the code was never ran in previous failure.

Additionally, a completely unrelated comment fix in Playwright config.
0ko 2026-06-01 18:01:10 +02:00
Gusted approved these changes 2026-06-02 14:45:42 +02:00
Gusted left a comment

Sure thanks!

Sure thanks!
Gusted merged commit eb76582261 into forgejo 2026-06-02 14:52:16 +02:00
Sign in to join this conversation.
No reviewers
No labels
arch
riscv64
backport/v1.19
backport/v1.20
backport/v1.21/forgejo
backport/v10.0/forgejo
backport/v11.0/forgejo
backport/v12.0/forgejo
backport/v13.0/forgejo
backport/v14.0/forgejo
backport/v15.0/forgejo
backport/v16.0/forgejo
backport/v7.0/forgejo
backport/v8.0/forgejo
backport/v9.0/forgejo
breaking
bug
bug
confirmed
bug
duplicate
bug
needs-more-info
bug
new-report
bug
reported-upstream
code/actions
code/api
code/auth
code/auth/faidp
code/auth/farp
code/email
code/federation
code/git
code/migrations
code/packages
code/wiki
database
MySQL
database
PostgreSQL
database
SQLite
dependency-upgrade
dependency
Chi
dependency
Chroma
dependency
F3
dependency
ForgeFed
dependency
garage
dependency
Gitea
dependency
Golang
Discussion
duplicate
enhancement/feature
forgejo/accessibility
forgejo/branding
forgejo/ci
forgejo/commit-graph
forgejo/documentation
forgejo/furnace cleanup
forgejo/i18n
forgejo/interop
forgejo/moderation
forgejo/privacy
forgejo/release
forgejo/scaling
forgejo/security
forgejo/ui
Gain
High
Gain
Nice to have
Gain
Undefined
Gain
Very High
good first issue
i18n/backport-stable
impact
large
impact
medium
impact
small
impact
unknown
Incompatible license
issue
closed
issue
do-not-exist-yet
issue
open
manual test
Manually tested during feature freeze
OS
FreeBSD
OS
Linux
OS
macOS
OS
Windows
problem
QA
regression
release blocker
Release Cycle
Feature Freeze
release-blocker
v7.0
release-blocker
v7.0.1
release-blocker
v7.0.2
release-blocker
v7.0.3
release-blocker
v7.0.4
release-blocker
v8.0.0
release-blocker/v9.0.0
run-all-playwright-tests
run-end-to-end-tests
stage
2-research
stage
3-design
stage
4-implementation
test
manual
test
needed
test
needs-help
test
not-needed
test
present
untested
User research - time-tracker
valuable code
worth a release-note
User research - Accessibility
User research - Blocked
User research - Community
User research - Config (instance)
User research - Errors
User research - Filters
User research - Future backlog
User research - Git workflow
User research - Labels
User research - Moderation
User research - Needs input
User research - Notifications/Dashboard
User research - Rendering
User research - Repo creation
User research - Repo units
User research - Security
User research - Settings (in-app)
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/forgejo!12871
No description provided.