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

Browser synthetics - test button shows "error" when results don't contain any logs #953

Open
peterschretlen opened this issue Oct 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working feature:browser

Comments

@peterschretlen
Copy link
Contributor

peterschretlen commented Oct 4, 2024

What happened:

When using the test button, the test result will show "there was an error running the test" if the test does not generate any logs

Image

If I add a console.log to the script, the error goes away:

Image

What you expected to happen:

There should be no error

How to reproduce it (as minimally and precisely as possible):

This test (a no-op script) will produce an error

import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {

}

This test (adds a console.log) has no error

import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  console.log("adding a console log fixes the error");
}

We seem to have an assumption that logs will be returned:

const info = JSON.parse(logsStr);
let df;
if (!info.logs) {
df = buildLogsDf([{ level: 'error', msg: 'There was an error running the test' }]);

@peterschretlen peterschretlen added bug Something isn't working feature:browser labels Oct 4, 2024
@peterschretlen peterschretlen changed the title Browser checks tests "error" when they don't contain any logs Browser synthetics - test button shows "error" when results don't contain any logs Oct 4, 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 feature:browser
Projects
None yet
Development

No branches or pull requests

2 participants