fix: ignore parens inside think-time sleeps#2258
Merged
Merged
Conversation
K6TestRefactorer counted ( and ) with no string-awareness, so a literal ) inside a header value (e.g. Chrome sec-ch-ua "Not/A)Brand";v="99") made parenCount drop to zero mid-headers. The think-time sleep() was then injected inside the headers object, breaking JS parsing in combined-scenarios.js when combineScenarios=true. Same fragility applied to brace-counting in JSESSION/Vaadin extraction insertion. Replace countOccurrences with countUnquotedOccurrences that tracks '..', ".." and `..` string state and honors backslash escapes. Fixes: #2253
Member
Author
|
Verified to fix the issue in https://github.com/vaadin/bookstore-example/tree/v25-loadtest. |
caalador
reviewed
May 25, 2026
| int scanFrom = functionBodyOpen | ||
| + "export default function() {".length(); | ||
|
|
||
| int parenBalance = 0; |
Contributor
There was a problem hiding this comment.
The verification is a bit complicated and would sound like a better approach would be to check that the expected sleep() lines exist and that they do not break the Not/A)Brand
Test Results 190 files 190 suites 24m 58s ⏱️ Results for commit 0eacf29. ♻️ This comment has been updated with latest results. |
caalador
approved these changes
May 25, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
K6TestRefactorercounted(and)with no string-awareness, so a literal)inside a header value (e.g. Chromesec-ch-ua"Not/A)Brand";v="99")made parenCount drop to zero mid-headers. The think-time sleep() was then injected inside the headers object, breaking JS parsing incombined-scenarios.jswhencombineScenarios=true. Same fragility applied to brace-counting in JSESSION/Vaadin extraction insertion.Replace countOccurrences with countUnquotedOccurrences that tracks
'..',".."and`.`string state and honors backslash escapes.Fixes: #2253