Closed adregan closed 3 years ago
thank you for the detailed bug report @adregan! would love a PR - no need to create a test suite for console-reporter
, a unit test for just the offending function would be great 😄
PR is opened https://github.com/artilleryio/artillery/pull/1157
Let me know if you'd like me to change anything.
Bug:
When running artillery with a scenario with a longer name, you will encounter the following error:
the
padded
function callsString.prototype.repeat()
which only allows positive integers from0
toInfinity
. In the event a negative number is encountered, aRangeError
is thrown.The
padded
fn determines the number of times to repeat the.
padding by subtracting the length of the string passed in from the default length of60
. This means that when interacting with the padded function directly, any string greater than 60 characters will raise an error. You can confirm in this small proof of concept here.padded
is called 7 times; 5 of those calls have a value hardcoded forstr1
that is certainly shorter than 60 chars; 2 of the calls route throughtrimName
.In those cases (routing through
trimName
), a scenario will have the the prependedcore.
stripped leaving the rest. So a scenario name that happens to be a bit longer, such that(s.len - 5) > 60
will lead to theRangeError
.I considered adding a failing test case and submitting a PR, but it appears that the console-reporter isn't covered by any tests.