From f1899b9eb1f84d5fdc21893422fc5d1c8d89d54f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 8 Jan 2025 15:53:19 +0000 Subject: [PATCH] Specify Synapse ui_auth.session_timeout only on tests which require it (#28939) * Specify Synapse ui_auth.session_timeout only on tests which require it As Dendrite lacks this configuration option Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../e2e/settings/device-management.spec.ts | 3 +++ .../uiaLongSessionTimeoutHomeserver.ts | 24 +++++++++++++++++++ playwright/testcontainers/synapse.ts | 4 +--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts diff --git a/playwright/e2e/settings/device-management.spec.ts b/playwright/e2e/settings/device-management.spec.ts index 4c1169ad094..949ce582e3a 100644 --- a/playwright/e2e/settings/device-management.spec.ts +++ b/playwright/e2e/settings/device-management.spec.ts @@ -7,7 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { test, expect } from "../../element-web-test"; +import { uiaLongSessionTimeoutHomeserver } from "../../plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts"; +// This is needed to not get stopped by UIA when deleting other devices +test.use(uiaLongSessionTimeoutHomeserver); test.describe("Device manager", () => { test.use({ displayName: "Alice", diff --git a/playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts b/playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts new file mode 100644 index 00000000000..1a0e41a71f7 --- /dev/null +++ b/playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts @@ -0,0 +1,24 @@ +/* +Copyright 2024 New Vector Ltd. + +SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial +Please see LICENSE files in the repository root for full details. +*/ + +import { Fixtures } from "@playwright/test"; + +import { Services } from "../../../services.ts"; + +export const uiaLongSessionTimeoutHomeserver: Fixtures<{}, Services> = { + synapseConfigOptions: [ + async ({ synapseConfigOptions }, use) => { + await use({ + ...synapseConfigOptions, + ui_auth: { + session_timeout: "300s", + }, + }); + }, + { scope: "worker" }, + ], +}; diff --git a/playwright/testcontainers/synapse.ts b/playwright/testcontainers/synapse.ts index 3b06db2325e..084ea480051 100644 --- a/playwright/testcontainers/synapse.ts +++ b/playwright/testcontainers/synapse.ts @@ -118,9 +118,7 @@ const DEFAULT_CONFIG = { password_config: { enabled: true, }, - ui_auth: { - session_timeout: "300s", - }, + ui_auth: {}, background_updates: { // Inhibit background updates as this Synapse isn't long-lived min_batch_size: 100000,