fix: causal cross-session test hung on Active-only filter, not a real bug
CI / skip-ci-check (pull_request) Successful in 4s
CI / docker-ci (pull_request) Successful in 7s
CI / secret-scan (pull_request) Successful in 14s
CI / admin-unit (pull_request) Successful in 1m21s
CI / viewer-unit (pull_request) Successful in 1m48s
CI / e2e (pull_request) Successful in 2m38s

statusBadgeText(email) after deactivating a user hung for the full test
timeout: ManageUsersContent.handleEditUser() refetches the list with the
current statusFilter ('active' by default) after every save, so the
just-deactivated row silently drops out of view — the locator then waits
forever for a row that filter will never show again (no actionTimeout is
configured, so only the outer test timeout eventually kills it).

Add ManageUsersPanel.showAllUsers() and switch to it before reading the
badge. Also gave the test more headroom (60s -> 120s) since it drives two
full UI logins plus create/edit/verify against a shared-CI DEV LXC.

Verified: full local suite green (37 passed, 6 skipped) against DEV.
This commit is contained in:
2026-07-14 23:19:40 -04:00
parent 262e7348d6
commit 317a135daa
2 changed files with 19 additions and 0 deletions
+10
View File
@@ -113,4 +113,14 @@ export class ManageUsersPanel extends BasePage {
async waitForRowGone(email: string, timeout = 15_000): Promise<void> {
await waitForHidden(this.row(email), { timeout });
}
/** The table defaults to the "Active only" filter and refetches with it on
* every save (`ManageUsersContent.handleEditUser` → `fetchUsers()`), so a
* just-deactivated row silently drops out of view. Switch to "All" before
* reading a status badge you expect to still be visible post-deactivation. */
async showAllUsers(): Promise<void> {
await this.click(this.page.locator('#status-filter'));
await this.click(this.page.getByRole('option', { name: 'All', exact: true }));
await waitForHidden(this.page.getByRole('option', { name: 'All', exact: true }));
}
}
@@ -95,6 +95,10 @@ test.describe('admin manage users: causal cross-session effect @smoke', () => {
timings,
}) => {
test.skip(!e2eCredentials, 'E2E_ADMIN_EMAIL/PASSWORD required (admin user)');
// Two full UI logins + create/edit/verify against a shared-CI DEV LXC push
// this past the default 60s under load (observed: a single login step
// alone took ~90s during a concurrent CI burst) — give it more headroom.
test.setTimeout(120_000);
const email = throwawayEmail('deactivate');
let userContext: import('@playwright/test').BrowserContext | undefined;
@@ -135,6 +139,11 @@ test.describe('admin manage users: causal cross-session effect @smoke', () => {
await manageUsersPanel.setActive(false);
await manageUsersPanel.saveEdit();
});
// The table defaults to (and refetches with) the "Active only" filter,
// so the just-deactivated row drops out of view immediately — switch to
// "All" before reading its badge, or this hangs forever waiting for a
// row that the current filter will never show again.
await manageUsersPanel.showAllUsers();
expect(await manageUsersPanel.statusBadgeText(email)).toMatch(/inactive/i);
await accountMenu.closeManageUsers();