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

panic: runtime error: integer divide by zero #1559

Closed
na-- opened this issue Jul 16, 2020 · 0 comments · Fixed by #1561
Closed

panic: runtime error: integer divide by zero #1559

na-- opened this issue Jul 16, 2020 · 0 comments · Fixed by #1561
Assignees
Milestone

Comments

@na--
Copy link
Member

na-- commented Jul 16, 2020

Created because of https://community.k6.io/t/warn-0000-error-getting-terminal-size/767

Environment

  • k6 version: v0.27.0
  • OS and version: Windows

Expected Behavior

Running a script with k6 shouldn't panic, ever.

Actual Behavior

For some terminals, k6 isn't able to get the current terminal width (needed for the new responsive progressbars) for some unknown reason, so it emits this warning:

 WARN[0000] error getting terminal size error=“The handle is invalid.”

then it panics with panic: runtime error: integer divide by zero 😞

my theory is that this code works as intended and falls back to width of 80: https://github.com/loadimpact/k6/blob/62e1b53391c2b2a8cd9e7af1d6a0cd70bd6227db/cmd/ui.go#L255-L258

but then we zero it out when we suppress the error here: https://github.com/loadimpact/k6/blob/62e1b53391c2b2a8cd9e7af1d6a0cd70bd6227db/cmd/ui.go#L334-L338

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

Successfully merging a pull request may close this issue.

2 participants