Skip to content

fix: ignore parens inside think-time sleeps#2258

Merged
caalador merged 3 commits into
mainfrom
fix/2253-thinktime
May 25, 2026
Merged

fix: ignore parens inside think-time sleeps#2258
caalador merged 3 commits into
mainfrom
fix/2253-thinktime

Conversation

@tltv

@tltv tltv commented May 25, 2026

Copy link
Copy Markdown
Member

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

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
@tltv

tltv commented May 25, 2026

Copy link
Copy Markdown
Member Author

Verified to fix the issue in https://github.com/vaadin/bookstore-example/tree/v25-loadtest.

@tltv tltv requested a review from caalador May 25, 2026 08:47
int scanFrom = functionBodyOpen
+ "export default function() {".length();

int parenBalance = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown

Test Results

  190 files    190 suites   24m 58s ⏱️
1 358 tests 1 352 ✅ 6 💤 0 ❌
1 811 runs  1 802 ✅ 9 💤 0 ❌

Results for commit 0eacf29.

♻️ This comment has been updated with latest results.

@caalador caalador enabled auto-merge (squash) May 25, 2026 12:20
@caalador caalador merged commit 6d87b93 into main May 25, 2026
11 checks passed
@caalador caalador deleted the fix/2253-thinktime branch May 25, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loadtest thinkTime broke combined-scenarios.js

2 participants