Skip to content

fix(scaletest/dashboard): increase viewport size and handle deadlines #10197

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

Merged
merged 10 commits into from
Oct 11, 2023

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Oct 10, 2023

So, turns out that headless chrome has a tiiny viewport by default. Like, 640x480 or something. Small enough to trigger our responsive mobile view. So, I just made the viewport bigger and it fixed things.

  • Added way more debug logging
  • We now write a screenshot on error in verbose mode (I'm open to making this a separate flag, but screenshots are an easy way to introspect headless browsers).
  • Added a deadline for each iteraction of clicking on and waiting for a thing.

@johnstcn johnstcn self-assigned this Oct 10, 2023
@johnstcn johnstcn changed the title fix(scaletest/dashboard): fix hanging issue fix(scaletest/dashboard): increase viewport size and handle deadlines Oct 10, 2023
@johnstcn johnstcn requested review from mafredri, Emyrk and mtojek October 10, 2023 22:01
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we link this PR with any issue?

@@ -178,6 +192,13 @@ func initChromeDPCtx(ctx context.Context, log slog.Logger, u *url.URL, sessionTo
}
}

// force a viewport size of 1024x768 so we don't go into mobile mode
if err := chromedp.Run(cdpCtx, chromedp.EmulateViewport(1024, 768)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you found this! I totally forgot about the default screen size of headless. 😮‍💨

@johnstcn johnstcn force-pushed the cj/scaletest-headless-waiting branch from 6cff4a5 to b044c4e Compare October 11, 2023 09:30
@johnstcn johnstcn merged commit b3471bd into main Oct 11, 2023
@johnstcn johnstcn deleted the cj/scaletest-headless-waiting branch October 11, 2023 10:10
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants