Extend the container-up time after the tests finished 07/139707/2
authorhalil.cakal <halil.cakal@est.tech>
Mon, 9 Dec 2024 17:38:35 +0000 (17:38 +0000)
committerhalil.cakal <halil.cakal@est.tech>
Tue, 10 Dec 2024 14:22:43 +0000 (14:22 +0000)
- extend it 5 mins for kpi test suit
- extend it 7 mins for endurance test suit

Issue-ID: CPS-2535

Change-Id: Ifecf2cdea67c12ff671da5f90e6715de7089e755
Signed-off-by: halil.cakal <halil.cakal@est.tech>
k6-tests/ncmp/common/utils.js
k6-tests/ncmp/config/endurance.json
k6-tests/ncmp/config/kpi.json
k6-tests/ncmp/ncmp-test-runner.js

index 589a248..8e68edd 100644 (file)
@@ -24,6 +24,7 @@ export const testConfig = JSON.parse(open(`../config/${__ENV.TEST_PROFILE}.json`
 export const KAFKA_BOOTSTRAP_SERVERS = testConfig.hosts.kafkaBootstrapServer;
 export const NCMP_BASE_URL = testConfig.hosts.ncmpBaseUrl;
 export const DMI_PLUGIN_URL = testConfig.hosts.dmiStubUrl;
+export const CONTAINER_UP_TIME_IN_SECONDS = testConfig.hosts.containerUpTimeInSeconds;
 export const LEGACY_BATCH_TOPIC_NAME = 'legacy_batch_topic';
 export const TOTAL_CM_HANDLES = 20000;
 export const REGISTRATION_BATCH_SIZE = 100;
index d215d0a..d4893a4 100644 (file)
@@ -2,7 +2,8 @@
   "hosts": {
     "ncmpBaseUrl": "http://localhost:8884",
     "dmiStubUrl": "http://ncmp-dmi-plugin-demo-and-csit-stub:8092",
-    "kafkaBootstrapServer": "localhost:9093"
+    "kafkaBootstrapServer": "localhost:9093",
+    "containerUpTimeInSeconds": 420
   },
   "scenarios": {
     "passthrough_read_scenario": {
index 2318702..eed041d 100644 (file)
@@ -2,7 +2,8 @@
   "hosts": {
     "ncmpBaseUrl": "http://localhost:8883",
     "dmiStubUrl": "http://ncmp-dmi-plugin-demo-and-csit-stub:8092",
-    "kafkaBootstrapServer": "localhost:9092"
+    "kafkaBootstrapServer": "localhost:9092",
+    "containerUpTimeInSeconds": 300
   },
   "scenarios": {
     "passthrough_read_scenario": {
index e33ff18..9ab326c 100644 (file)
  *  ============LICENSE_END=========================================================
  */
 
-import { check } from 'k6';
+import { check, sleep } from 'k6';
 import { Trend } from 'k6/metrics';
 import { Reader } from 'k6/x/kafka';
 import {
     TOTAL_CM_HANDLES, READ_DATA_FOR_CM_HANDLE_DELAY_MS, WRITE_DATA_FOR_CM_HANDLE_DELAY_MS,
     makeCustomSummaryReport, makeBatchOfCmHandleIds, LEGACY_BATCH_THROUGHPUT_TEST_BATCH_SIZE,
     REGISTRATION_BATCH_SIZE, LEGACY_BATCH_THROUGHPUT_TEST_NUMBER_OF_REQUESTS, KAFKA_BOOTSTRAP_SERVERS,
-    LEGACY_BATCH_TOPIC_NAME, testConfig
+    LEGACY_BATCH_TOPIC_NAME, CONTAINER_UP_TIME_IN_SECONDS, testConfig
 } from './common/utils.js';
 import { createCmHandles, deleteCmHandles, waitForAllCmHandlesToBeReady } from './common/cmhandle-crud.js';
 import { executeCmHandleSearch, executeCmHandleIdSearch } from './common/search-base.js';
@@ -97,6 +97,8 @@ export function teardown() {
     const totalDeregistrationTimeInSeconds = (endTimeInMillis - startTimeInMillis) / 1000.0;
 
     cmHandlesDeletedPerSecondTrend.add(DEREGISTERED_CM_HANDLES / totalDeregistrationTimeInSeconds);
+
+    sleep(CONTAINER_UP_TIME_IN_SECONDS);
 }
 
 export function passthroughReadScenario() {