Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit 3764b59

Browse files
authored
fix: Flaky testPositionalQueryParameters (#2059)
String comparison of values, eg `1.40845209522E9` vs `1408452095.22` seems to be failing, so comparing the values as epoc (Long) instead Fixes #2056 ☕️
1 parent 1c7a0ab commit 3764b59

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3438,7 +3438,12 @@ public void testPositionalQueryParameters() throws InterruptedException {
34383438
assertEquals(QUERY_RESULT_SCHEMA_BIGNUMERIC, result.getSchema());
34393439
assertEquals(2, Iterables.size(result.getValues()));
34403440
for (FieldValueList values : result.iterateAll()) {
3441-
assertEquals("1.40845209522E9", values.get(0).getValue());
3441+
// https://github.com/googleapis/java-bigquery/issues/2056. String comparison of values, eg
3442+
// 1.40845209522E9 vs 1408452095.22 seems to be failing, so comparing the values as epoc
3443+
// (Long) instead
3444+
assertEquals(
3445+
(long) Double.parseDouble("1.40845209522E9"),
3446+
(long) Double.parseDouble(values.get(0).getValue().toString()));
34423447
assertEquals("stringValue", values.get(1).getValue());
34433448
assertEquals(false, values.get(2).getBooleanValue());
34443449
assertEquals("0.33333333333333333333333333333333333333", values.get(3).getValue());

0 commit comments

Comments
 (0)