Skip to content

Commit

Permalink
test: fix ITDatabaseAdminTest failures (#2976)
Browse files Browse the repository at this point in the history
* test: fix ITDatabaseAdminTest failures

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* exclude owlbot pre-processor run on kokoro config

* remove reduntant assert

* fix test

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
rahul2393 and gcf-owl-bot[bot] authored Mar 26, 2024
1 parent a23d89f commit fd08c12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
Expand Down Expand Up @@ -260,9 +262,14 @@ public void updateDatabaseInvalidFieldsToUpdate() {
OperationFuture<Database, UpdateDatabaseMetadata> op =
dbAdminClient.updateDatabase(databaseToUpdate);

ExecutionException e =
assertThrows(ExecutionException.class, () -> op.get(5, TimeUnit.MINUTES));
assertThat(e.getMessage()).contains("Invalid field mask");
try {
op.get(5, TimeUnit.MINUTES);
Assert.fail("No exception thrown");
} catch (ExecutionException | InterruptedException | TimeoutException e) {
Assert.assertTrue(e.getCause() instanceof SpannerException);
SpannerException exception = ((SpannerException) e.getCause());
assertEquals(ErrorCode.INVALID_ARGUMENT, exception.getErrorCode());
}
}

@Test
Expand Down
1 change: 1 addition & 0 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
excludes=[
".kokoro/continuous/common.cfg",
".kokoro/nightly/common.cfg",
".kokoro/nightly/integration.cfg",
".kokoro/nightly/java8-samples.cfg",
".kokoro/nightly/java11-samples.cfg",
".kokoro/nightly/samples.cfg",
Expand Down

0 comments on commit fd08c12

Please sign in to comment.