Skip to content
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

Handle case when first value is 0 in test_cumulative_aggregation_with_random_data #4139

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1043,14 +1043,15 @@ def collect_and_validate(values, histogram) -> None:
# run this test case with the same values used in a previous execution,
# check the value printed by that previous execution of this test case
# and use the same value for the seed variable in the line below.
# seed = 4539544373807492135
# seed = 3373389994391084876

random_generator = Random(seed)
print(f"seed for {currentframe().f_code.co_name} is {seed}")

values = []
for i in range(2000):
value = random_generator.randint(0, 1000)
# avoid both values being 0
value = random_generator.randint(0 if i else 1, 1000)
values.append(value)
histogram.aggregate(Measurement(value, Mock()))
if i % 20 == 0:
Expand Down