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

StopAsError function issue #4113

Open
2 tasks done
moulimurugesan10 opened this issue Mar 17, 2024 · 4 comments
Open
2 tasks done

StopAsError function issue #4113

moulimurugesan10 opened this issue Mar 17, 2024 · 4 comments
Labels

Comments

@moulimurugesan10
Copy link

Have you read the documentation?

URL

TestUrl

What are you trying to accomplish

My requirement is running multiples scripts in single execution.

I get some xpath not find errors so I used stopAsError to handle errors.
StopAsError Works fine for single script but when we try to run multiple scripts Html report was not generated also I am getting following error

If my script fails in first iteration and passed in second iteration I get the below error :

ERROR: Could not find the right index x for har for url xxxxx
ERROR: There are pages that misses data. This is in almost all cases caused by that you try to measure a page view but you do not navigate to a new page. Error: PageIndex out of range
throw new Error(Page summary message (${type}) didn't specify a group.);
Error: Page summary message (browsertime.pageSummary) didn't specify a group.

if my script fails in both iteration I getting below error only
throw new Error(Page summary message (${type}) didn't specify a group.);
Error: Page summary message (browsertime.pageSummary) didn't specify a group.

Note:

  • I handled all the non navigation measurement with stopwatch
  • I only facing this issue when I try to run multiple scripts. If I run single script for multiple Iteration there is no error and report also generated

What browser did you use?

Chrome

How to reproduce

I used windows for this test

command:
sitespeed.io.cmd --multi Script1.js Script2.js

implement error in script1 and handle it with following command in catch
return commands.measure.stopAsError('Failed in step 1');

Log output

No response

@soulgalore
Copy link
Member

Hi @moulimurugesan10 thank you for creating the bug report! Hmm, I wonder I think I could have missed testing it in a multi step scenario. Let me try to reproduce this tonight and see if I can fix it.

@moulimurugesan10
Copy link
Author

Thanks @soulgalore let me know once the fix is done

@soulgalore
Copy link
Member

The problem happens if run multiple tests and one fail. That code needs some more love so I think I could have fix by the of this week.

soulgalore added a commit to sitespeedio/browsertime that referenced this issue Mar 19, 2024
The old version was kind of broken that returned partly result json.

This fix makes sure the test return as a failure (as documented) and
remove all result data (as documented).

sitespeedio/sitespeed.io#4113
soulgalore added a commit to sitespeedio/browsertime that referenced this issue Mar 20, 2024
* Make stopAsError report failures.

The old version was kind of broken that returned partly result json.

This fix makes sure the test return as a failure (as documented) and
remove all result data (as documented).

sitespeedio/sitespeed.io#4113
@soulgalore
Copy link
Member

Hi @moulimurugesan10 can you please try newly released 33.4.0, When I tried, that works for me, but want your input too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants