Skip to content

sql: deflake TestStatusAPIStatements and TestStatusAPICombinedStatements#69591

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
xinhaoz:deflake-statements-api-tests
Aug 30, 2021
Merged

sql: deflake TestStatusAPIStatements and TestStatusAPICombinedStatements#69591
craig[bot] merged 1 commit intocockroachdb:masterfrom
xinhaoz:deflake-statements-api-tests

Conversation

@xinhaoz
Copy link
Copy Markdown
Contributor

@xinhaoz xinhaoz commented Aug 30, 2021

Fixes: #69557

As mentioned in #69533, we have a race condition in tests
where we request statements stats with start=now. In these
tests we expect to see no results, but because in-memory
stats have the aggregated_ts field set on iterator return,
depending on the time the test is run we might see
results returned.

For example, suppose we insert stats at 15:45. If we then request
stats at 16:00, requesting only stats aggregated after or at the
current time, i.e. start=16:00, the aggregated_ts for in-memory
stats will be set to 16:00 and thus we will see results
returned.

To deflake these tests, we stub the aggregated_ts field to
a predetermined value.

Release justification: non-production code changes
Release note: None

Fixes: cockroachdb#69557

As mentioned in cockroachdb#69533, we have a race condition in tests
where we request statements stats with start=now. In these
tests we expect to see no results, but because in-memory
stats have the aggregated_ts field set on iterator return,
depending on the time the test is run we might see
results returned.

For example, suppose we insert stats at 15:45. If we then request
stats at 16:00, requesting only stats aggregated after or at the
current time, i.e. start=16:00, the aggregated_ts for in-memory
stats will be set to 16:00 and thus we will see results
returned.

To deflake these tests, we stub the aggregated_ts field to
a predetermined value.

Release justification: non-production code changes
Release note: None
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@xinhaoz xinhaoz requested review from a team and Azhng and removed request for Azhng August 30, 2021 16:08
Copy link
Copy Markdown
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@xinhaoz
Copy link
Copy Markdown
Contributor Author

xinhaoz commented Aug 30, 2021

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 30, 2021

Build succeeded:

@craig craig bot merged commit e76382b into cockroachdb:master Aug 30, 2021
@xinhaoz xinhaoz deleted the deflake-statements-api-tests branch September 7, 2021 01:10
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.

server: TestStatusAPIStatements failed

3 participants