Skip to content

Commit

Permalink
Fix flaky BigQuery testInsertSameValues
Browse files Browse the repository at this point in the history
  • Loading branch information
hashhar committed Nov 23, 2022
1 parent aac3758 commit 10d52dc
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import static io.trino.testing.assertions.Assert.assertEquals;
import static io.trino.testing.assertions.Assert.assertEventually;
import static java.lang.String.format;
import static java.lang.String.join;
import static java.util.Collections.nCopies;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.testng.Assert.assertFalse;
Expand Down Expand Up @@ -802,6 +804,19 @@ public void testInsertArray()
}
}

@Override
public void testInsertSameValues()
{
// TODO Remove override once https://github.com/trinodb/trino/issues/14981 is addressed
// queries with empty projections (count(*)) can return incorrect results for tables which are written to recently
try (TestTable table = new TestTable(
getQueryRunner()::execute,
"insert_same_values",
"AS " + join(" UNION ALL ", nCopies(2, "SELECT * FROM region")))) {
assertThat(computeActual("SELECT regionkey FROM " + table.getName()).getRowCount()).isEqualTo(10);
}
}

@Override
protected String errorMessageForCreateTableAsSelectNegativeDate(String date)
{
Expand Down

0 comments on commit 10d52dc

Please sign in to comment.