fix: avoid mutating summarize_args list in summarize()#10132
Closed
norus wants to merge 1 commit intoaws:developfrom
Closed
fix: avoid mutating summarize_args list in summarize()#10132norus wants to merge 1 commit intoaws:developfrom
norus wants to merge 1 commit intoaws:developfrom
Conversation
The summarize() function was calling .extend() on summarize_args in-place before the second subprocess.check_call(). This mutates the original list, making the function non-idempotent: repeated calls accumulate duplicate --output-format flags. Construct a new list for the JSON invocation instead. Fixes aws#10121
Author
|
Closing as duplicate of #10127 which was opened first with the same fix. |
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.
Summary
Fix a list mutation bug in
scripts/performance/benchmark_utils.py.Closes #10121
Problem
summarize()called.extend()on the sharedsummarize_argslist before the secondsubprocess.check_call(). This mutates the list in-place, making the function non-idempotent: any repeated call accumulates duplicate--output-format jsonflags.Fix
Construct a new list for the JSON invocation, leaving the original untouched.
Testing
Verified locally that
summarize_argsis not mutated after the call, and the JSON summary subprocess receives exactly the expected arguments.