-
Notifications
You must be signed in to change notification settings - Fork 156
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
fix: 224 action hangs in some cases for go fiber benchmarks #225
Conversation
* fix reExtract regexp to avoid catastrophic backtracking * add test cases from fiber that were causing issues
…le metrics in Go but they were not extracted properly before v1.18.0
@@ -353,7 +353,7 @@ function extractGoResult(output: string): BenchmarkResult[] { | |||
// "A benchmark result line has the general form: <name> <iterations> <value> <unit> [<value> <unit>...]" | |||
// "The fields are separated by runs of space characters (as defined by unicode.IsSpace), so the line can be parsed with strings.Fields. The line must have an even number of fields, and at least four." | |||
const reExtract = | |||
/^(?<name>Benchmark\w+(?:\/?[\w()$%^&*-=,]*?)*?)(?<procs>-\d+)?\s+(?<times>\d+)\s+(?<remainder>.+)$/; | |||
/^(?<name>Benchmark\w+[\w()$%^&*-=|,[\]{}"#]*?)(?<procs>-\d+)?\s+(?<times>\d+)\s+(?<remainder>.+)$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds some additional characters that were present in Go Fiber benchmarks as well as removes the nested (()*?)*? which was causing the regex to hang in some instances
@@ -209,6 +209,12 @@ describe('extractResult()', function () { | |||
value: 40537.456, | |||
extra: '30001 times', | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the backward compatible metric as before v1.18.0 it was resulting like that in case of multiple metrics
fixes #224