Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend support for browser tests #403

Open
chan4lk opened this issue May 14, 2024 · 1 comment
Open

Extend support for browser tests #403

chan4lk opened this issue May 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@chan4lk
Copy link

chan4lk commented May 14, 2024

Brief summary

When the total number of virtual users are more than 100 the runner image is not spawning new jobs.

k6-operator version or image

grafana/k6:0.50.0-with-browser

Helm chart version (if applicable)

No response

TestRun / PrivateLoadZone YAML

apiVersion: k6.io/v1alpha1
kind: TestRun
metadata:
name: run-k6-from-configmap-ui
spec:
parallelism: 4
separate: true
runner:
image: grafana/k6:master-with-browser
script:
configMap:
name: scenarios-test
file: LOAD-test.js
arguments: --out cloud

Other environment details (if applicable)

AKS

Steps to reproduce the problem

import { textSummary } from 'https://jslib.k6.io/k6-summary/0.0.1/index.js';
import { browser } from 'k6/experimental/browser';
import { sleep, check } from 'k6';

export function handleSummary(data) {
return {
stdout: textSummary(data, { indent: ' ', enableColors: true }),
};
}

export const options = {
"discardResponseBodies": true,
"thresholds": {
"checks": [
"rate==1.0"
],
"browser_web_vital_lcp": [
"p(95)<3000",
"max<5000"
],
"iteration_duration": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:root}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:root}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:news}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:news}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:solar}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:solar}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:statistics}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:statistics}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:contact}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:contact}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:tariff}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:tariff}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:publications}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:publications}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:resources}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:resources}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:powergrids}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:powergrids}": [
"max<31000",
"p(95)<26000"
],
"browser_web_vital_lcp{page:licensees}": [
"max>0",
"max<5000",
"p(95)<3000"
],
"iteration_duration{scenario:licensees}": [
"max<31000",
"p(95)<26000"
]
},
"cloud": {
"name": "http://example.net LOAD Tests",
"projectID": *****
},
"scenarios": {
"root": {
"exec": "root",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "root"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"news": {
"exec": "news",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "news"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"solar": {
"exec": "solar",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "solar"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"statistics": {
"exec": "statistics",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "statistics"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"contact": {
"exec": "contact",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "contact"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"tariff": {
"exec": "tariff",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "tariff"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"publications": {
"exec": "publications",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "publications"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"resources": {
"exec": "resources",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "resources"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"powergrids": {
"exec": "powergrids",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "powergrids"
},
"options": {
"browser": {
"type": "chromium"
}
}
},
"licensees": {
"exec": "licensees",
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{
"duration": "12s",
"target": 20
},
{
"duration": "96s",
"target": 20
},
{
"duration": "12s",
"target": 0
}
],
"gracefulRampDown": "0s",
"tags": {
"page": "licensees"
},
"options": {
"browser": {
"type": "chromium"
}
}
}
}
};

export async function navigate(url){
const page = browser.newPage();

  try {
    await page.goto('http://example.net' + url);
    page.waitForSelector('.cmp-pre-loader', { state: 'hidden'});
    check(page, {
      'root visible': p => p.locator('.root') && p.locator('.root').isVisible() 
    })
    sleep(1);
  } finally {
    page.close();
  }

}

export async function root () { await navigate('/'); }

Expected behaviour

K6 operator should spin runner jobs.

Actual behaviour

No runner jobs are started.

@chan4lk chan4lk added the bug Something isn't working label May 14, 2024
@yorugac yorugac added enhancement New feature or request and removed bug Something isn't working labels May 14, 2024
@yorugac
Copy link
Collaborator

yorugac commented May 14, 2024

Hi @chan4lk, thanks for opening the issue. As of now, browser tests are not considered fully working with k6-operator. We've been tracking that in this PR so far:
#289
I'm renaming this issue to be more specific about the problem.

@yorugac yorugac changed the title More than 100 virtual users are not working with browser image Extend support for browser tests May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants