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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
only screenshot in verbose mode
  • Loading branch information
johnstcn committed Oct 11, 2023
commit 4be6c51436d195f9220c735dec2f98ffac0f5cc7
5 changes: 5 additions & 0 deletions cli/exp_scaletest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,11 @@ func (r *RootCmd) scaletestDashboard() *clibase.Cmd {
Headless: headless,
RandIntn: rndGen.Intn,
}
// Only take a screenshot if we're in verbose mode.
// This could be useful for debugging, but it will blow up the disk.
if r.verbose {
config.Screenshot = dashboard.Screenshot
}
//nolint:gocritic
logger.Info(ctx, "runner config", slog.F("interval", interval), slog.F("jitter", jitter), slog.F("headless", headless), slog.F("trace", tracingEnabled))
if err := config.Validate(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion scaletest/dashboard/chromedp.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func visitMainPage(ctx context.Context, u *url.URL) error {
return chromedp.Run(ctx, chromedp.Navigate(u.String()))
}

func screenshot(ctx context.Context, name string) (string, error) {
func Screenshot(ctx context.Context, name string) (string, error) {
var buf []byte
if err := chromedp.Run(ctx, chromedp.CaptureScreenshot(&buf)); err != nil {
return "", xerrors.Errorf("capture screenshot: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion scaletest/dashboard/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewRunner(client *codersdk.Client, metrics Metrics, cfg Config) *Runner {
cfg.ActionFunc = clickRandomElement
}
if cfg.Screenshot == nil {
cfg.Screenshot = screenshot
cfg.Screenshot = Screenshot
}
return &Runner{
client: client,
Expand Down