Skip to content

Commit 12e6ea9

Browse files
committed
test: fix useless waiting for app config cache
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent ae3f497 commit 12e6ea9

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

tests/playwright/e2e/core/header-contacts-menu.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ test.describe('Header: Contacts menu', () => {
9494
test('users from other groups are not seen when user enumeration is restricted to the same group', async ({ page, contactUser }) => {
9595
// Enable restriction first, then open the menu.
9696
await runOcc(['config:app:set', '--value', 'yes', 'core', 'shareapi_restrict_user_enumeration_to_group'])
97-
await new Promise((resolve) => globalThis.setTimeout(resolve, 3000)) // wait for app config cache to expire
9897
try {
9998
await page.goto('/')
10099
const contactsMenu = new ContactsMenuPage(page)
@@ -106,9 +105,7 @@ test.describe('Header: Contacts menu', () => {
106105

107106
// Close, lift the restriction, reopen — the contact should reappear.
108107
await runOcc(['config:app:set', '--value', 'no', 'core', 'shareapi_restrict_user_enumeration_to_group'])
109-
const waitForAppConfigCacheTTL = new Promise((resolve) => globalThis.setTimeout(resolve, 3000)) // wait for app config cache to expire
110108
await contactsMenu.close()
111-
await waitForAppConfigCacheTTL
112109

113110
await page.reload()
114111
await contactsMenu.open()

tests/playwright/start-nextcloud-server.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,19 @@ async function start() {
4949
await configureNextcloud()
5050

5151
process.stdout.write('\nApply custom configuration for Playwright tests\n')
52+
await runExec(['php', '-r', '$db = new SQLite3("data/owncloud.db");$db->busyTimeout(5000);$db->exec("PRAGMA journal_mode = wal;");'])
53+
process.stdout.write('├─ Enabled SQLite WAL mode for better performance\n')
54+
55+
await runOcc(['config:system:set', 'cache_app_config', '--value', 'false', '--type', 'boolean'])
56+
process.stdout.write('├─ Disabled caching AppConfig\n') // otherwise test setup using OCC will need to wait 3s so that web cache TTL expires
57+
5258
await runOcc(['config:system:set', 'appstoreenabled', '--value', 'false', '--type', 'boolean'])
5359
process.stdout.write('├─ Disabled app store\n')
60+
5461
// createRandomUser() generates short passwords that the policy would reject
5562
await runOcc(['app:disable', 'password_policy'])
5663
process.stdout.write('├─ Disabled password policy for random test users\n')
57-
await runExec(['php', '-r', '$db = new SQLite3("data/owncloud.db");$db->busyTimeout(5000);$db->exec("PRAGMA journal_mode = wal;");'])
58-
process.stdout.write('├─ Enabled SQLite WAL mode for better performance\n')
64+
5965
process.stdout.write('├─ Initialize cron job...\n')
6066
await runExec(['php', 'cron.php'])
6167
process.stdout.write('│ └─ OK !\n')

0 commit comments

Comments
 (0)