From d90b432e06bd7daa1b2122691323a32a29f0d0f3 Mon Sep 17 00:00:00 2001 From: Evilham Date: Fri, 31 Mar 2023 10:16:22 +0200 Subject: [PATCH] [stress-tests] Adapt for NC 25 This still supports NC24 While there, configure JMeter to restart threads instead of stopping them. This keeps the load on the target server. --- stress-tests/dd-stress-test.tpl.jmx | 8 ++++---- stress-tests/dd-tests-selenium.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/stress-tests/dd-stress-test.tpl.jmx b/stress-tests/dd-stress-test.tpl.jmx index 060d0d8..b05b8b8 100644 --- a/stress-tests/dd-stress-test.tpl.jmx +++ b/stress-tests/dd-stress-test.tpl.jmx @@ -139,7 +139,7 @@ - stopthread + startnextloop false -1 @@ -192,8 +192,8 @@ Send response from login to SP for processing - - false + + true saveConfig @@ -230,7 +230,7 @@ - false + true saveConfig diff --git a/stress-tests/dd-tests-selenium.py b/stress-tests/dd-tests-selenium.py index 2dc94af..2c57501 100644 --- a/stress-tests/dd-tests-selenium.py +++ b/stress-tests/dd-tests-selenium.py @@ -20,6 +20,9 @@ from selenium.webdriver.chrome.options import Options as ChromeOptions from typing import Any, Dict, Iterable, List +STEP_TIMEOUT_SECONDS = 40 + + class DDSession: driver: webdriver.Chrome @@ -28,7 +31,7 @@ class DDSession: instance: str, users_file: str, out_dir: pathlib.Path, - stepTimeoutSeconds: int = 20, + stepTimeoutSeconds: int = STEP_TIMEOUT_SECONDS, ): self.instance = instance self.users_file = [ @@ -177,6 +180,7 @@ class DDSession: lambda d: ( d.find_elements(By.ID, "kc-form-login") + d.find_elements(By.ID, "menu-apps-icon") + + d.find_elements(By.ID, "menu-apps-btn") ) ) @@ -213,7 +217,7 @@ class DDSession: self.screenshot("OnlyOffice", "Opening") # Wait for OnlyOffice to start loading - oofCSS = "div.app-onlyoffice #app iframe" + oofCSS = ".app-onlyoffice #app iframe" WebDriverWait(self.driver, timeout=self.stepTimeoutSeconds).until( lambda d: d.find_elements(By.CSS_SELECTOR, oofCSS) ) @@ -292,13 +296,13 @@ def main_test( users_file: io.TextIOWrapper, out_dir: pathlib.Path, duration: int, - stepTimeoutSeconds: int = 20, + stepTimeoutSeconds: int = STEP_TIMEOUT_SECONDS, ) -> DDSession: session = DDSession( instance=instance, users_file=users_file.read(), out_dir=out_dir, - stepTimeoutSeconds=20, + stepTimeoutSeconds=stepTimeoutSeconds, ) first_run = True