Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit 73a505d

Browse files
committed
test: remove write fraction from test
1 parent facda8a commit 73a505d

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolStressTest.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@
6262
public class SessionPoolStressTest extends BaseSessionPoolTest {
6363

6464
@Parameter(0)
65-
public double writeSessionsFraction;
66-
67-
@Parameter(1)
6865
public boolean shouldBlock;
6966

7067
DatabaseId db = DatabaseId.of("projects/p/instances/i/databases/unused");
@@ -85,13 +82,11 @@ public class SessionPoolStressTest extends BaseSessionPoolTest {
8582
int minSessionsWhenSessionClosed = Integer.MAX_VALUE;
8683
Exception e;
8784

88-
@Parameters(name = "write fraction = {0}, should block = {1}")
85+
@Parameters(name = "should block = {0}")
8986
public static Collection<Object[]> data() {
9087
List<Object[]> params = new ArrayList<>();
91-
for (double writeFraction = 0; writeFraction <= 1; writeFraction += 0.5) {
92-
params.add(new Object[] {writeFraction, true});
93-
params.add(new Object[] {writeFraction, false});
94-
}
88+
params.add(new Object[] {true});
89+
params.add(new Object[] {false});
9590
return params;
9691
}
9792

@@ -236,12 +231,8 @@ public void stressTest() throws Exception {
236231
setupSpanner(db);
237232
int minSessions = 2;
238233
int maxSessions = concurrentThreads / 2;
239-
float writeSessionsFraction = 0.5f;
240234
SessionPoolOptions.Builder builder =
241-
SessionPoolOptions.newBuilder()
242-
.setMinSessions(minSessions)
243-
.setMaxSessions(maxSessions)
244-
.setWriteSessionsFraction(writeSessionsFraction);
235+
SessionPoolOptions.newBuilder().setMinSessions(minSessions).setMaxSessions(maxSessions);
245236
if (shouldBlock) {
246237
builder.setBlockIfPoolExhausted();
247238
} else {
@@ -273,7 +264,7 @@ public void run() {
273264
PooledSessionFuture session = pool.getSession();
274265
session.get();
275266
Uninterruptibles.sleepUninterruptibly(
276-
random.nextInt(5), TimeUnit.MILLISECONDS);
267+
random.nextInt(2), TimeUnit.MILLISECONDS);
277268
resetTransaction(session.get().delegate);
278269
session.close();
279270
} catch (SpannerException e) {

0 commit comments

Comments
 (0)