fix: anchor gridKeys regex to grid item rows in generated k6#2242
Merged
Conversation
The previous regex /"key":"[^"]+"/g matched both grid item rows ({"key":"1","col0":...}) and change-record keys ({"node":N,"type":"put","key":"highlight",...}). On responses with no grid items it overwrote gridKeys with property names like "highlight" or "tag", causing select() RPCs to send garbage keys and downstream resolveNode() throws (e.g. "unresolved node: abc"). Anchoring on `{` matches only keys that are the first property of an object, so grid items are picked up and change-record keys are ignored; when no items are present, gridKeys keeps its previous valid contents.
Replace the naive walker in K6ScenarioCombiner. The combiner is now agnostic to braces in human-written comments and string literals.
Member
Author
|
Verified to work with https://github.com/vaadin/bookstore-example/tree/v25-loadtest. |
caalador
reviewed
May 11, 2026
| assertEquals(1, handleSummaryCount, | ||
| "Combined script must export exactly one handleSummary. Got:\n" | ||
| + content); | ||
| assertTrue(content.contains("export function alphaScenario()"), |
Contributor
There was a problem hiding this comment.
This doesn't really check that the function is correctly wrapped, only that the function export has been added with the file name. should probably check the body given to writeScenario is there, or all the lines are found as full lines.
Member
Author
There was a problem hiding this comment.
Added scenario wrapper body line asserts.
caalador
approved these changes
May 11, 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.
The previous regex
/"key":"[^"]+"/gmatched both grid item rows({"key":"1","col0":...})and change-record keys({"node":N,"type":"put","key":"highlight",...}). On responses with no grid items it overwrotegridKeyswith property names like "highlight" or "tag", causing select() RPCs to send garbage keys and downstream resolveNode() throws (e.g. "unresolved node: abc"). Anchoring on{matches only keys that are the first property of an object, so grid items are picked up and change-record keys are ignored; when no items are present, gridKeys keeps its previous valid contents.Replace the naive walker in
K6ScenarioCombiner. The combiner is now agnostic to braces in human-written comments and string literals.