Fixed admin tests
* Increased timeout. * Wait for disconnect only if no admintest.
This commit is contained in:
parent
c2699e4528
commit
d8e0975f97
4 changed files with 4 additions and 2 deletions
|
@ -46,7 +46,7 @@ const closeServer = async () => {
|
||||||
for (const socket of sockets) socket.destroy(new Error('HTTP server is closing'));
|
for (const socket of sockets) socket.destroy(new Error('HTTP server is closing'));
|
||||||
}, 5000);
|
}, 5000);
|
||||||
let lastLogged = 0;
|
let lastLogged = 0;
|
||||||
while (sockets.size > 0) {
|
while (sockets.size > 0 && !settings.enableAdminUITests) {
|
||||||
if (Date.now() - lastLogged > 1000) { // Rate limit to avoid filling logs.
|
if (Date.now() - lastLogged > 1000) { // Rate limit to avoid filling logs.
|
||||||
logger.info(`Waiting for ${sockets.size} HTTP clients to disconnect...`);
|
logger.info(`Waiting for ${sockets.size} HTTP clients to disconnect...`);
|
||||||
lastLogged = Date.now();
|
lastLogged = Date.now();
|
||||||
|
|
|
@ -38,7 +38,7 @@ export const expressCloseServer = async () => {
|
||||||
// not appear to be a way to get all clients across all namespaces without tracking them
|
// not appear to be a way to get all clients across all namespaces without tracking them
|
||||||
// ourselves, so that is what we do.
|
// ourselves, so that is what we do.
|
||||||
let lastLogged = 0;
|
let lastLogged = 0;
|
||||||
while (sockets.size > 0) {
|
while (sockets.size > 0 && !settings.enableAdminUITests) {
|
||||||
if (Date.now() - lastLogged > 1000) { // Rate limit to avoid filling logs.
|
if (Date.now() - lastLogged > 1000) { // Rate limit to avoid filling logs.
|
||||||
logger.info(`Waiting for ${sockets.size} socket.io clients to disconnect...`);
|
logger.info(`Waiting for ${sockets.size} socket.io clients to disconnect...`);
|
||||||
lastLogged = Date.now();
|
lastLogged = Date.now();
|
||||||
|
|
|
@ -55,5 +55,6 @@ test.describe('admin settings',()=> {
|
||||||
const settings = page.locator('.settings');
|
const settings = page.locator('.settings');
|
||||||
await expect(settings).not.toBeEmpty();
|
await expect(settings).not.toBeEmpty();
|
||||||
await page.waitForSelector('.menu')
|
await page.waitForSelector('.menu')
|
||||||
|
await page.waitForTimeout(5000)
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -66,6 +66,7 @@ test.describe('Plugins page', ()=> {
|
||||||
await expect(installedPluginsRows).toHaveCount(1, {
|
await expect(installedPluginsRows).toHaveCount(1, {
|
||||||
timeout: 15000
|
timeout: 15000
|
||||||
})
|
})
|
||||||
|
await page.waitForTimeout(5000)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue