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

Fix StressTests Java BigQueryIO job flakiness #32803

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
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 @@ -84,6 +84,7 @@ public final class BigQueryIOST extends IOStressTestBase {
private static final String READ_ELEMENT_METRIC_NAME = "read_count";
private static final String STORAGE_WRITE_API_METHOD = "STORAGE_WRITE_API";
private static final String STORAGE_API_AT_LEAST_ONCE_METHOD = "STORAGE_API_AT_LEAST_ONCE";
private static final int STORAGE_API_AT_LEAST_ONCE_MAX_ALLOWED_DIFFERENCE = 10_000;
Copy link
Contributor

Choose a reason for hiding this comment

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

I imagine the difference could be linear to the total number of elements. How about allowed different fraction?


private static BigQueryResourceManager resourceManager;
private static String tableName;
Expand Down Expand Up @@ -336,9 +337,12 @@ private void generateDataAndWrite(BigQueryIO.Write<byte[]> writeIO) throws IOExc
if (configuration.writeMethod.equals(STORAGE_API_AT_LEAST_ONCE_METHOD)) {
assertTrue(
String.format(
"Number of rows in the table (%d) is less than the expected number (%d). Missing records: %d",
rowCount, (long) numRecords, (long) numRecords - rowCount),
rowCount >= numRecords);
"Row difference (%d) exceeds the limit of %d. Rows: %d, Expected: %d",
(long) numRecords - rowCount,
STORAGE_API_AT_LEAST_ONCE_MAX_ALLOWED_DIFFERENCE,
rowCount,
(long) numRecords),
(long) numRecords - rowCount <= STORAGE_API_AT_LEAST_ONCE_MAX_ALLOWED_DIFFERENCE);
} else {
assertTrue(
String.format(
Expand Down
Loading