Skip to content

Commit 5d2b9da

Browse files
test(spanner): unflake ITAutogeneratedAdminClientTest
This fixes a timeout in roleWithNoPermissions and grantAndRevokeDatabaseRolePermissions where the spanner DatabaseClient instance was not closed before dropping the role, causing the backend DROP ROLE DDL to block on active session pool connections.
1 parent 1d92aa5 commit 5d2b9da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITAutogeneratedAdminClientTest.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ public void grantAndRevokeDatabaseRolePermissions() throws Exception {
166166
assertThat(e.getErrorCode()).isEqualTo(ErrorCode.PERMISSION_DENIED);
167167
assertThat(e.getMessage()).contains(dbRoleParent);
168168
}
169+
spanner.close();
169170
// Drop role and table.
170171
final String dropTableT = "DROP TABLE T";
171172
final String dropRoleParent = String.format("DROP ROLE %s", dbRoleParent);
@@ -209,6 +210,7 @@ public void roleWithNoPermissions() throws Exception {
209210
assertThat(e.getErrorCode()).isEqualTo(ErrorCode.PERMISSION_DENIED);
210211
assertThat(e.getMessage()).contains(dbRoleOrphan);
211212
}
213+
spanner.close();
212214
// Drop role and table.
213215
final String dropTableT = "DROP TABLE T";
214216
final String dropRoleParent = String.format("DROP ROLE %s", dbRoleOrphan);

0 commit comments

Comments
 (0)