From ae213d1f438935863d3102c0a959c1ad1456c694 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 08:11:13 +0300 Subject: [PATCH 01/15] Update the scenarios for k6 tests --- packages/js/k6/src/frontend/scenarios.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index 5e5642deece..d2ad791c5f0 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -106,14 +106,19 @@ const createScenario = ( funcName: Action ): Scenario => { return { - executor: "per-vu-iterations", + timeUnit: __ENV.scenario_time_utin || "1m", + rate: parseInt(__ENV.scenario_rate) || 20, + duration: __ENV.scenario_duration || "1m", + preAllocatedVUs: 100, + maxVUs: 200, + executor: "constant-arrival-rate", env, exec: funcName, // k6 CLI flags do not allow override scenario options, so we need to add our own // Ideally we would use default // https://community.grafana.com/t/overriding-vus-individual-scenario/98923 - vus: parseFloat(__ENV.scenario_vus) || 5, - iterations: parseFloat(__ENV.scenario_iterations) || 40, + // vus: parseFloat(__ENV.scenario_vus) || 5, + // iterations: parseFloat(__ENV.scenario_iterations) || 40 } } From 772729e77faf7a18062ffbe2e5944ec8dd44ebd6 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 11:53:01 +0300 Subject: [PATCH 02/15] Update the scenarios for k6 tests to run for 3m --- packages/js/k6/src/frontend/scenarios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index d2ad791c5f0..0bb1cd0cc00 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -108,7 +108,7 @@ const createScenario = ( return { timeUnit: __ENV.scenario_time_utin || "1m", rate: parseInt(__ENV.scenario_rate) || 20, - duration: __ENV.scenario_duration || "1m", + duration: __ENV.scenario_duration || "3m", preAllocatedVUs: 100, maxVUs: 200, executor: "constant-arrival-rate", From 751e2b37cc2ac113c8e05cab0a75ca197c930a38 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 12:27:24 +0300 Subject: [PATCH 03/15] Update the scenarios for k6 tests to run for 5m --- packages/js/k6/src/frontend/scenarios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index 0bb1cd0cc00..672edfd2294 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -108,7 +108,7 @@ const createScenario = ( return { timeUnit: __ENV.scenario_time_utin || "1m", rate: parseInt(__ENV.scenario_rate) || 20, - duration: __ENV.scenario_duration || "3m", + duration: __ENV.scenario_duration || "5m", preAllocatedVUs: 100, maxVUs: 200, executor: "constant-arrival-rate", From 0aec85373c775f082a89884f91e38692fa04fcff Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 12:45:28 +0300 Subject: [PATCH 04/15] Revert "Re-add the memory leak for testing" This reverts commit 38f40e89d005b9b68c8f214f22181c1995bb02cf. --- frontend/src/stores/ui.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/frontend/src/stores/ui.ts b/frontend/src/stores/ui.ts index e0a5744e96e..ec5fefd9778 100644 --- a/frontend/src/stores/ui.ts +++ b/frontend/src/stores/ui.ts @@ -71,22 +71,20 @@ export interface UiState { export const breakpoints = Object.keys(ALL_SCREEN_SIZES) -export const defaultUiState: UiState = { - instructionsSnackbarState: "not_shown", - innerFilterVisible: false, - isFilterDismissed: false, - isDesktopLayout: false, - breakpoint: "sm", - dismissedBanners: [], - shouldBlurSensitive: true, - revealedSensitiveResults: [], - headerHeight: 80, - colorMode: "system", - isDarkModeSeen: false, -} - export const useUiStore = defineStore("ui", { - state: (): UiState => ({ ...defaultUiState }), + state: (): UiState => ({ + instructionsSnackbarState: "not_shown", + innerFilterVisible: false, + isFilterDismissed: false, + isDesktopLayout: false, + breakpoint: "sm", + dismissedBanners: [], + shouldBlurSensitive: true, + revealedSensitiveResults: [], + headerHeight: 80, + colorMode: "system", + isDarkModeSeen: false, + }), getters: { cookieState(state): OpenverseCookieState["ui"] { From 62e4ae5c24490fc6662674b179cc08bf6e5c5cf5 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 13:08:54 +0300 Subject: [PATCH 05/15] Increase the rate x1.5 --- packages/js/k6/src/frontend/scenarios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index 672edfd2294..f6b25d5d599 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -107,7 +107,7 @@ const createScenario = ( ): Scenario => { return { timeUnit: __ENV.scenario_time_utin || "1m", - rate: parseInt(__ENV.scenario_rate) || 20, + rate: parseInt(__ENV.scenario_rate) || 30, duration: __ENV.scenario_duration || "5m", preAllocatedVUs: 100, maxVUs: 200, From b01a3cf7ae0d454080ea5e3ab149d48313df1d17 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 13:23:33 +0300 Subject: [PATCH 06/15] Revert "Revert "Re-add the memory leak for testing"" This reverts commit a239799f2f27372bf73730339c57eecce59bd57f. --- frontend/src/stores/ui.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/src/stores/ui.ts b/frontend/src/stores/ui.ts index ec5fefd9778..e0a5744e96e 100644 --- a/frontend/src/stores/ui.ts +++ b/frontend/src/stores/ui.ts @@ -71,20 +71,22 @@ export interface UiState { export const breakpoints = Object.keys(ALL_SCREEN_SIZES) +export const defaultUiState: UiState = { + instructionsSnackbarState: "not_shown", + innerFilterVisible: false, + isFilterDismissed: false, + isDesktopLayout: false, + breakpoint: "sm", + dismissedBanners: [], + shouldBlurSensitive: true, + revealedSensitiveResults: [], + headerHeight: 80, + colorMode: "system", + isDarkModeSeen: false, +} + export const useUiStore = defineStore("ui", { - state: (): UiState => ({ - instructionsSnackbarState: "not_shown", - innerFilterVisible: false, - isFilterDismissed: false, - isDesktopLayout: false, - breakpoint: "sm", - dismissedBanners: [], - shouldBlurSensitive: true, - revealedSensitiveResults: [], - headerHeight: 80, - colorMode: "system", - isDarkModeSeen: false, - }), + state: (): UiState => ({ ...defaultUiState }), getters: { cookieState(state): OpenverseCookieState["ui"] { From 56c1293ad4926af197667dc3d776f98c95b4c60c Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 13:42:53 +0300 Subject: [PATCH 07/15] Increase the rate x2 --- packages/js/k6/src/frontend/scenarios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index f6b25d5d599..08ddc0a4756 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -107,7 +107,7 @@ const createScenario = ( ): Scenario => { return { timeUnit: __ENV.scenario_time_utin || "1m", - rate: parseInt(__ENV.scenario_rate) || 30, + rate: parseInt(__ENV.scenario_rate) || 40, duration: __ENV.scenario_duration || "5m", preAllocatedVUs: 100, maxVUs: 200, From 9f6444c0e7628573dab1b3014ad79716c115ebdb Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 14:02:03 +0300 Subject: [PATCH 08/15] Decrease the rate back to 30 --- packages/js/k6/src/frontend/scenarios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index 08ddc0a4756..f6b25d5d599 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -107,7 +107,7 @@ const createScenario = ( ): Scenario => { return { timeUnit: __ENV.scenario_time_utin || "1m", - rate: parseInt(__ENV.scenario_rate) || 40, + rate: parseInt(__ENV.scenario_rate) || 30, duration: __ENV.scenario_duration || "5m", preAllocatedVUs: 100, maxVUs: 200, From 964d9625abebbef637d941327e3c9f95e30c0a8d Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 14:05:44 +0300 Subject: [PATCH 09/15] Revert "Revert "Revert "Re-add the memory leak for testing""" This reverts commit 874fa666feb99494ec18d0630537320cd072638c. --- frontend/src/stores/ui.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/frontend/src/stores/ui.ts b/frontend/src/stores/ui.ts index e0a5744e96e..ec5fefd9778 100644 --- a/frontend/src/stores/ui.ts +++ b/frontend/src/stores/ui.ts @@ -71,22 +71,20 @@ export interface UiState { export const breakpoints = Object.keys(ALL_SCREEN_SIZES) -export const defaultUiState: UiState = { - instructionsSnackbarState: "not_shown", - innerFilterVisible: false, - isFilterDismissed: false, - isDesktopLayout: false, - breakpoint: "sm", - dismissedBanners: [], - shouldBlurSensitive: true, - revealedSensitiveResults: [], - headerHeight: 80, - colorMode: "system", - isDarkModeSeen: false, -} - export const useUiStore = defineStore("ui", { - state: (): UiState => ({ ...defaultUiState }), + state: (): UiState => ({ + instructionsSnackbarState: "not_shown", + innerFilterVisible: false, + isFilterDismissed: false, + isDesktopLayout: false, + breakpoint: "sm", + dismissedBanners: [], + shouldBlurSensitive: true, + revealedSensitiveResults: [], + headerHeight: 80, + colorMode: "system", + isDarkModeSeen: false, + }), getters: { cookieState(state): OpenverseCookieState["ui"] { From 33fa7a9d96a19a2bf3352c99ff8c01f8ac194346 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 14:37:01 +0300 Subject: [PATCH 10/15] Decrease the rate to 10 --- packages/js/k6/src/frontend/scenarios.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index f6b25d5d599..09c2f379b29 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -106,19 +106,17 @@ const createScenario = ( funcName: Action ): Scenario => { return { + // k6 CLI flags do not allow override scenario options, so we need to add our own + // Ideally we would use default + // https://community.grafana.com/t/overriding-vus-individual-scenario/98923 timeUnit: __ENV.scenario_time_utin || "1m", - rate: parseInt(__ENV.scenario_rate) || 30, + rate: parseInt(__ENV.scenario_rate) || 10, duration: __ENV.scenario_duration || "5m", preAllocatedVUs: 100, maxVUs: 200, executor: "constant-arrival-rate", env, exec: funcName, - // k6 CLI flags do not allow override scenario options, so we need to add our own - // Ideally we would use default - // https://community.grafana.com/t/overriding-vus-individual-scenario/98923 - // vus: parseFloat(__ENV.scenario_vus) || 5, - // iterations: parseFloat(__ENV.scenario_iterations) || 40 } } From f5b87ac708051c014f1abd09313289e00988bd64 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 14:51:52 +0300 Subject: [PATCH 11/15] Lower the duration to 4 minutes --- packages/js/k6/src/frontend/scenarios.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index 09c2f379b29..4d7fdafc3eb 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -106,17 +106,17 @@ const createScenario = ( funcName: Action ): Scenario => { return { + executor: "constant-arrival-rate", + env, + exec: funcName, // k6 CLI flags do not allow override scenario options, so we need to add our own // Ideally we would use default // https://community.grafana.com/t/overriding-vus-individual-scenario/98923 timeUnit: __ENV.scenario_time_utin || "1m", rate: parseInt(__ENV.scenario_rate) || 10, - duration: __ENV.scenario_duration || "5m", + duration: __ENV.scenario_duration || "4m", preAllocatedVUs: 100, maxVUs: 200, - executor: "constant-arrival-rate", - env, - exec: funcName, } } From b6b9b93e05501ca2e50681e45693981884ded414 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 15:20:59 +0300 Subject: [PATCH 12/15] Lower the rate to 3 --- packages/js/k6/src/frontend/scenarios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index 4d7fdafc3eb..c5181047d70 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -113,7 +113,7 @@ const createScenario = ( // Ideally we would use default // https://community.grafana.com/t/overriding-vus-individual-scenario/98923 timeUnit: __ENV.scenario_time_utin || "1m", - rate: parseInt(__ENV.scenario_rate) || 10, + rate: parseInt(__ENV.scenario_rate) || 3, duration: __ENV.scenario_duration || "4m", preAllocatedVUs: 100, maxVUs: 200, From a8d7c1780f6422d1399030f5e5e37ef16ef6d3af Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 25 Nov 2024 16:11:05 +0300 Subject: [PATCH 13/15] Lower the VU counts --- packages/js/k6/src/frontend/scenarios.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index c5181047d70..09cece59527 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -115,8 +115,8 @@ const createScenario = ( timeUnit: __ENV.scenario_time_utin || "1m", rate: parseInt(__ENV.scenario_rate) || 3, duration: __ENV.scenario_duration || "4m", - preAllocatedVUs: 100, - maxVUs: 200, + preAllocatedVUs: 10, + maxVUs: 20, } } From 4704c717f1f65543860d742790d64b6cdba13ddc Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Fri, 29 Nov 2024 11:07:18 +0300 Subject: [PATCH 14/15] Extract the defaultUiState to an object --- frontend/src/stores/ui.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/src/stores/ui.ts b/frontend/src/stores/ui.ts index ec5fefd9778..e0a5744e96e 100644 --- a/frontend/src/stores/ui.ts +++ b/frontend/src/stores/ui.ts @@ -71,20 +71,22 @@ export interface UiState { export const breakpoints = Object.keys(ALL_SCREEN_SIZES) +export const defaultUiState: UiState = { + instructionsSnackbarState: "not_shown", + innerFilterVisible: false, + isFilterDismissed: false, + isDesktopLayout: false, + breakpoint: "sm", + dismissedBanners: [], + shouldBlurSensitive: true, + revealedSensitiveResults: [], + headerHeight: 80, + colorMode: "system", + isDarkModeSeen: false, +} + export const useUiStore = defineStore("ui", { - state: (): UiState => ({ - instructionsSnackbarState: "not_shown", - innerFilterVisible: false, - isFilterDismissed: false, - isDesktopLayout: false, - breakpoint: "sm", - dismissedBanners: [], - shouldBlurSensitive: true, - revealedSensitiveResults: [], - headerHeight: 80, - colorMode: "system", - isDarkModeSeen: false, - }), + state: (): UiState => ({ ...defaultUiState }), getters: { cookieState(state): OpenverseCookieState["ui"] { From 83782065ff0f7c828628033945a7f94aa28936d3 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Fri, 29 Nov 2024 11:51:53 +0300 Subject: [PATCH 15/15] Run longer in staging --- .github/workflows/k6.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/k6.yml b/.github/workflows/k6.yml index faf4e3fe0b3..87a846fb3e9 100644 --- a/.github/workflows/k6.yml +++ b/.github/workflows/k6.yml @@ -55,6 +55,7 @@ jobs: just k6 ${{ inputs.namespace }} ${{ inputs.scenario }} \ ${{ inputs.report && '-o cloud' || ''}} \ -e signing_secret="$K6_SIGNING_SECRET" \ + -e scenario_duration="6m" \ -e service_url=${{ inputs.service_url }} \ -e text_summary=/tmp/k6-summary.txt