Skip to content

Commit

Permalink
Increase timeout to 1 minute for BigQuery access policy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Mar 1, 2023
1 parent 7876a18 commit 6511f15
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package io.trino.plugin.bigquery;

import io.airlift.units.Duration;
import io.trino.Session;
import io.trino.testing.BaseConnectorTest;
import io.trino.testing.MaterializedResult;
Expand All @@ -38,6 +39,7 @@
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.util.concurrent.TimeUnit.MINUTES;
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 @@ -434,10 +436,10 @@ public void testSelectTableWithRowAccessPolicyFilterAll()

// Use assertEventually because there's delay until new row access policies become effective
onBigQuery("CREATE ROW ACCESS POLICY " + policyName + " ON " + table.getName() + " FILTER USING (true)");
assertEventually(() -> assertQueryReturnsEmptyResult("SELECT * FROM " + table.getName()));
assertEventually(new Duration(1, MINUTES), () -> assertQueryReturnsEmptyResult("SELECT * FROM " + table.getName()));

onBigQuery("DROP ALL ROW ACCESS POLICIES ON " + table.getName());
assertEventually(() -> assertQuery("SELECT * FROM " + table.getName(), "VALUES 1"));
assertEventually(new Duration(1, MINUTES), () -> assertQuery("SELECT * FROM " + table.getName(), "VALUES 1"));
}
}

Expand All @@ -450,10 +452,10 @@ public void testSelectTableWithRowAccessPolicyFilterPartialRow()

// Use assertEventually because there's delay until new row access policies become effective
onBigQuery("CREATE ROW ACCESS POLICY " + policyName + " ON " + table.getName() + " GRANT TO (\"allAuthenticatedUsers\") FILTER USING (col = 1)");
assertEventually(() -> assertQuery("SELECT * FROM " + table.getName(), "VALUES 1"));
assertEventually(new Duration(1, MINUTES), () -> assertQuery("SELECT * FROM " + table.getName(), "VALUES 1"));

onBigQuery("DROP ALL ROW ACCESS POLICIES ON " + table.getName());
assertEventually(() -> assertQuery("SELECT * FROM " + table.getName(), "VALUES (1), (2)"));
assertEventually(new Duration(1, MINUTES), () -> assertQuery("SELECT * FROM " + table.getName(), "VALUES (1), (2)"));
}
}

Expand Down

0 comments on commit 6511f15

Please sign in to comment.