Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ public void testSpannerReturnsAllAvailableSessionsAndThenNoSessions()
}

@Test
public void testSpannerReturnsResourceExhausted() throws InterruptedException {
public void testSpannerReturnsFailedPrecondition() throws InterruptedException {
int minSessions = 100;
int maxSessions = 1000;
int expectedSessions;
DatabaseClientImpl client;
// Make the first BatchCreateSessions return an error.
mockSpanner.addException(Status.RESOURCE_EXHAUSTED.asRuntimeException());
mockSpanner.addException(Status.FAILED_PRECONDITION.asRuntimeException());
try (Spanner spanner = createSpanner(minSessions, maxSessions)) {
// Create a database client which will create a session pool.
client =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ public void batchCreateSessions(
batchCreateSessionsExecutionTime.simulateExecutionTime(
exceptions, stickyGlobalExceptions, freezeLock);
if (sessions.size() >= maxTotalSessions) {
throw Status.RESOURCE_EXHAUSTED
throw Status.FAILED_PRECONDITION
.withDescription("Maximum number of sessions reached")
.asRuntimeException();
}
Expand Down