-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ws.Set(Timeout/Interval) panicking on float values (#1608)
The issue is connected to dop251/goja#190 in the sense that instead of the float to int conversation to result in either error or a clamped float value, it results in a 0 int value which panics the stdlib time package. Changing the parameter for the timeout/interval to float both makes it possible to take values such as 0.5, meaning half a ms, and also checks if the value is positive so we can be certain that it won't panic k6. If not this results in an exception in the script. Co-authored-by: Ivan Mirić <ivan@loadimpact.com>
- Loading branch information
Showing
2 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters