Skip to content

Commit

Permalink
fix: Flaky testPositionalQueryParameters (#2059)
Browse files Browse the repository at this point in the history
String comparison of values, eg `1.40845209522E9` vs `1408452095.22` seems to be failing, so comparing the values as epoc (Long) instead

Fixes #2056 ☕️
  • Loading branch information
prash-mi committed May 24, 2022
1 parent 1c7a0ab commit 3764b59
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -3438,7 +3438,12 @@ public void testPositionalQueryParameters() throws InterruptedException {
assertEquals(QUERY_RESULT_SCHEMA_BIGNUMERIC, result.getSchema());
assertEquals(2, Iterables.size(result.getValues()));
for (FieldValueList values : result.iterateAll()) {
assertEquals("1.40845209522E9", values.get(0).getValue());
// https://github.com/googleapis/java-bigquery/issues/2056. String comparison of values, eg
// 1.40845209522E9 vs 1408452095.22 seems to be failing, so comparing the values as epoc
// (Long) instead
assertEquals(
(long) Double.parseDouble("1.40845209522E9"),
(long) Double.parseDouble(values.get(0).getValue().toString()));
assertEquals("stringValue", values.get(1).getValue());
assertEquals(false, values.get(2).getBooleanValue());
assertEquals("0.33333333333333333333333333333333333333", values.get(3).getValue());
Expand Down

0 comments on commit 3764b59

Please sign in to comment.