synthetic-monitoring-app
synthetic-monitoring-app copied to clipboard
Browser synthetics - test button shows "error" when results don't contain any logs
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
If I add a console.log
to the script, the error goes away:
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: https://github.com/grafana/synthetic-monitoring-app/blob/26d0c5b8889b70bb98e2b9e2725a563e9afda74b/src/components/CheckTestResultsModal.tsx#L106-L109