Repository navigation
test(bigtable): stabilize flaky backup and client-side metrics tests #9761
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,24 +48,14 @@ function getInterval( | |
| dataPoint: | ||
| DataPoint<number> | DataPoint<Histogram> | DataPoint<ExponentialHistogram>, | ||
| ) { | ||
| let endSec = dataPoint.endTime[0]; | ||
| let endNanos = dataPoint.endTime[1]; | ||
| const startSec = dataPoint.startTime[0]; | ||
| const startNanos = dataPoint.startTime[1]; | ||
|
|
||
| if (startSec > endSec || (startSec === endSec && startNanos > endNanos)) { | ||
| endSec = startSec; | ||
| endNanos = startNanos; | ||
| } | ||
|
|
||
| return { | ||
| endTime: { | ||
| seconds: endSec, | ||
| nanos: endNanos, | ||
| seconds: dataPoint.endTime[0], | ||
| nanos: dataPoint.endTime[1], | ||
| }, | ||
| startTime: { | ||
| seconds: startSec, | ||
| nanos: startNanos, | ||
| seconds: dataPoint.startTime[0], | ||
| nanos: dataPoint.startTime[1], | ||
| }, | ||
| }; | ||
|
Comment on lines
51
to
60
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverting the interval check entirely from the production exporter leaves production environments vulnerable to metric export failures if let endSec = dataPoint.endTime[0];
let endNanos = dataPoint.endTime[1];
const startSec = dataPoint.startTime[0];
const startNanos = dataPoint.startTime[1];
if (startSec > endSec || (startSec === endSec && startNanos >= endNanos)) {
const adjustedNanos = startNanos + 1000000;
if (adjustedNanos >= 1000000000) {
endSec = startSec + 1;
endNanos = adjustedNanos - 1000000000;
} else {
endSec = startSec;
endNanos = adjustedNanos;
}
}
return {
endTime: {
seconds: endSec,
nanos: endNanos,
},
startTime: {
seconds: startSec,
nanos: startNanos,
},
};
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think I agree with this. https://github.com/googleapis/google-cloud-node/pull/9717/changes#r4401545583 offers this solution, but failed exporter calls are silent so it doesn't bombard the user with errors and we don't want hidden code somewhere artificially manipulating the data. |
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The changes here are actually just reverting changes that were applied in 1ea27c9#diff-39c2f3c691ce7c9e2f54ab8c9020dff4aef632d80a11aa13fe19074c889aaad5R51-R60. We do not want the client side metrics exporter artificially warping collected client side metrics data which is what this commit did.
If we can change the tests instead then that would offer a much better solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this PR attempts to change the tests instead to solve the Flakey test problem.