-
Notifications
You must be signed in to change notification settings - Fork 42
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
panic: runtime error: invalid memory address or nil pointer dereference #1148
Comments
Hey @rauldeheer ! Thanks for reporting this. I've moved it to an appropriate repository. Also, can you share a minimal example of the script (without sharing your internals) that is causing that panic? Thanks! |
@olegbespalov Hey! Thanks for responding, but unfortunately it will be hard for me to provide you with an example, as we have a big case with a specific private application. However, we're only navigating through pages and it sometimes just crashes. It never crashes on the same line, it's random. What could I do to make this easier to test on your end? What we do:
|
@rauldeheer to me, it seems enough details for an attempt to reproduce the bug, but the k6-browser team will get back to you once they have a chance to have a look and prioritize this issue 👍 Thanks! |
@olegbespalov Thank you and I'm looking forward to seeing the result of this issue. |
For extra reference, here's the script. Since it has almost no context to the application we can easily share it with the world: import { type Options } from 'k6/options';
import { type Page, browser } from 'k6/experimental/browser';
import { sleep } from 'k6';
import { BASE_URL } from '../config/constants';
export const options: Options = {
scenarios: {
register: {
executor: 'per-vu-iterations',
vus: 1,
maxDuration: '1000s',
options: {
browser: {
type: 'chromium'
}
}
}
}
};
export default async function () {
const context = browser.newContext();
context.grantPermissions(['camera', 'microphone', 'clipboard-write']);
const mainPage = context.newPage();
const controlsPage = context.newPage();
await signIn(mainPage);
await turnOnStream(mainPage);
// // console.log(mainPage.url());
// sleep(1);
await gameLoop(controlsPage, mainPage.url());
// sleep(Infinity);
}
async function signIn(page: Page) {
await page.goto(BASE_URL + '/login/password?from=%2Fwelcome');
sleep(5);
const usernameInput = page.locator('input[data-cy="username"]');
usernameInput.type('admin');
const passwordInput = page.locator('input[data-cy="password"]');
passwordInput.type('Test123!');
const loginButton = page.locator('button[type="submit"]');
await loginButton.click();
sleep(1);
}
async function turnOnStream(page: Page) {
await page.goto(BASE_URL + '/admin/game', { waitUntil: 'networkidle' });
sleep(5);
const viewButton = page.locator('[data-test="game-page-btn-0"');
await viewButton.click();
sleep(4);
const streamButton = page.locator('[data-test="admin-tab-stream-chat"');
await streamButton.click();
sleep(5);
const publishButton = page.locator('[data-test="publish-button"]');
await publishButton.click();
// sleep(3);
// await publishButton.click();
sleep(2);
console.log('sdf');
}
async function gameLoop(page: Page, gameUrl: string) {
// await page.goto('https://www.google.com/');
// sleep(Infinity);
// console.log('89045860945809');
// sleep(3);
// page.waitForLoadState('networkidle');
await page.goto(gameUrl, { waitUntil: 'networkidle' });
sleep(100);
// sleep(10);
// console.log('sdf');
// page.waitForSelector('[data-test="admin-tab-live-controls"]');
// const controlsButton = page.locator('[data-test="admin-tab-live-controls"]');
// await controlsButton.click({ button: 'middle' });
// sleep(1);
// page.waitForSelector('[data-test="game-start-button"] :not(disabled)', {
// timeout: 0
// });
// console.log('button freed.');
// sleep(10);
// const startButton = page.locator('[data-test="game-start-button"]');
// await startButton.click();
// sleep(Infinity);
} |
Hi @rauldeheer, Thanks for the details and test test script. Is there any chance you've been able to recreate this against a publicly accessible website? I've not been able to reproduce the issue yet, but i'm guessing the website under test is one that contains From an issue standpoint it would seem that the issue lies here where the |
@rauldeheer we think we've fixed the issue, and the fix will be in the next release of k6 (v0.49.0). If you would like to test the latest version of the browser module with the fix (and if you have Go installed) then follow these instructions:
|
Brief summary
We're trying to run a test within our application using the k6x-browser. We're encountering a weird issue where the test sometimes crashes with the following error:
k6 version
0.48.0
OS
macOS 14 (arm) - Sonoma 14.2.1 (23C71)
Docker version and image (if applicable)
No response
Steps to reproduce the problem
Use a browser test and navigate through multiple pages. Try it a few times, eventually it will crash.
Expected behaviour
No crash, or at least a more detailed error.
Actual behaviour
Crashing with a GoLang error
Tasks
The text was updated successfully, but these errors were encountered: