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

Executor error "could not get a VU from the buffer" when UI test is running too long #1395

Open
michal-babel-eit opened this issue Jun 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@michal-babel-eit
Copy link

michal-babel-eit commented Jun 25, 2024

Brief summary

I have multiple ui scenarios setup to run one after another with maxDuration and gracefulStop. If some scenario is stuck on something, it is not killed and the next scenario doesn't run due to an executor error. See attached script and terminal output for details.

k6 version

k6 v0.51.0 (go1.22.3, darwin/arm64)

OS

macOS Sonoma 14.4.1

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Run this script via K6_BROWSER_HEADLESS=false k6 run browser.js

browser.js:

import { browser } from "k6/experimental/browser";

export const options = {
  scenarios: {
    ui1: {
      executor: "per-vu-iterations",
      exec: "u1",
      iterations: 1,
      maxDuration: "5s",
      gracefulStop: "5s",
      vus: 1,
      options: {
        browser: {
          type: "chromium",
        },
      },
    },

    ui2: {
      executor: "per-vu-iterations",
      exec: "u2",
      iterations: 1,
      maxDuration: "5s",
      gracefulStop: "5s",
      startTime: "15s",
      vus: 1,
      options: {
        browser: {
          type: "chromium",
        },
      },
    },
  },
};

export async function u1() {
  const page = browser.newPage();
  try {
    await page.goto("https://example.com");
    page.locator("//*[text()='nonsense']").waitFor({ timeout: 20000 });
  } finally {
    page.close();
  }
}
export async function u2() {
  const page = browser.newPage();
  try {
    await page.goto("https://example.com");
    page.locator("//*[text()='nonsense']").waitFor({ timeout: 20000 });
  } finally {
    page.close();
  }
}

Expected behaviour

The first scenario is killed (within maxDuration + gracefulStop) and second starts up properly

Actual behaviour

The second scenario does not start due to executor error:

K6_BROWSER_HEADLESS=false k6 run browser.js

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

     execution: local
        script: browser.js
        output: -

     scenarios: (100.00%) 2 scenarios, 1 max VUs, 25s max duration (incl. graceful stop):
              * ui1: 1 iterations for each of 1 VUs (maxDuration: 5s, exec: u1, gracefulStop: 5s)
              * ui2: 1 iterations for each of 1 VUs (maxDuration: 5s, exec: u2, startTime: 15s, gracefulStop: 5s)

ERRO[0001] Failed to load resource: the server responded with a status of 404 ()  browser_source=network line_number=0 source=browser stacktrace="<nil>" url="https://example.com/favicon.ico"
WARN[0015] Could not get a VU from the buffer for 400ms  executor=per-vu-iterations scenario=ui2
WARN[0016] Could not get a VU from the buffer for 800ms  executor=per-vu-iterations scenario=ui2
WARN[0016] Could not get a VU from the buffer for 1.2s   executor=per-vu-iterations scenario=ui2
WARN[0016] Could not get a VU from the buffer for 1.6s   executor=per-vu-iterations scenario=ui2
WARN[0017] Could not get a VU from the buffer for 2s     executor=per-vu-iterations scenario=ui2
ERRO[0017] Executor error                                error="could not get a VU from the buffer in 2s" executor=ui2 startTime=15s type=per-vu-iterations
WARN[0021]                                               error="context is done before all 'IterEnd' events were processed"

     browser_data_received.......: 3.2 kB 154 B/s
     browser_data_sent...........: 670 B  32 B/s
     browser_http_req_duration...: avg=278.31ms min=110.74ms med=278.31ms max=445.88ms p(90)=412.36ms p(95)=429.12ms
     browser_http_req_failed.....: 50.00% ✓ 1     ✗ 1  
     browser_web_vital_fcp.......: avg=487.59ms min=487.59ms med=487.59ms max=487.59ms p(90)=487.59ms p(95)=487.59ms
     browser_web_vital_ttfb......: avg=445.29ms min=445.29ms med=445.29ms max=445.29ms p(90)=445.29ms p(95)=445.29ms
     data_received...............: 0 B    0 B/s
     data_sent...................: 0 B    0 B/s
     vus.........................: 1      min=1   max=1
     vus_max.....................: 1      min=1   max=1


running (21.1s), 0/1 VUs, 0 complete and 1 interrupted iterations
ui1  ✓ [======================================] 1 VUs  5s       0/1 iters, 1 per VU
ui2  ✗ [--------------------------------------] 1 VUs  2.0s/5s  0/1 iters, 1 per VU
ERRO[0021] could not get a VU from the buffer in 2s     
@michal-babel-eit michal-babel-eit added the bug Something isn't working label Jun 25, 2024
@mstoykov mstoykov transferred this issue from grafana/k6 Jul 3, 2024
@mstoykov mstoykov assigned inancgumus and unassigned mstoykov Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants