backupccl: deflake test reading job record#45369
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Feb 26, 2020
Merged
backupccl: deflake test reading job record#45369craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
299b54b to
fcc550c
Compare
These tests read the job created by a backup directly from the jobs table immediately after running the backup to verify which fields the raw job does or does not contain. However background jobs like table statistics mean that the test cannot always assume that the job it just ran is exactly the most recent row in the jobs table. Previously the test attempted to solve this by disabling automatic stats, but this settings change is not instant and races with the stats process. In some rare cases, the test was thus encountering unexpected stats jobs when it expected backup jobs. Instead of disabling stats, this changes the test to look the 10 most recent jobs and filter out those that are backups to check the fields they do or don't contain. This side-steps the inexact timing of disabling stats, and indeed allows leaving them enabled, which is nice given that the test is also testing their handling within backups. Release note: none.
fcc550c to
2b41fdf
Compare
pbardea
approved these changes
Feb 26, 2020
Contributor
pbardea
left a comment
There was a problem hiding this comment.
LGTM, would this also affect tests which use latestJobId()?
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @pbardea)
Contributor
Author
|
Seems likely -- i think most of those users are skipped, potentially because of this. Let's look at that in a separate follow-up. TFTR! bors r+ |
Contributor
Build failed (retrying...) |
Contributor
Build succeeded |
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.
These tests read the job created by a backup directly from the jobs table
immediately after running the backup to verify which fields the raw job
does or does not contain. However background jobs like table statistics
mean that the test cannot always assume that the job it just ran is exactly
the most recent row in the jobs table.
Previously the test attempted to solve this by disabling automatic stats,
but this settings change is not instant and races with the stats process.
In some rare cases, the test was thus encountering unexpected stats jobs
when it expected backup jobs.
Instead of disabling stats, this changes the test to look the 10 most recent
jobs and filter out those that are backups to check the fields they
do or don't contain. This side-steps the inexact timing of disabling stats,
and indeed allows leaving them enabled, which is nice given that the test
is also testing their handling within backups.
Fixes #44985.
Release note: none.