Skip to content

Commit 4a28b55

Browse files
committed
Setup cycleTest in the same txn
In order to have multiple threads running against same cluster, this has to be done.
1 parent a82ab69 commit 4a28b55

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

bindings/java/src/integration/com/apple/foundationdb/CycleMultiClientIntegrationTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,15 @@ private static synchronized void setupThreads(FDB fdb) {
7373

7474
private static void setup(Collection<Database> dbs) {
7575
// 0 -> 1 -> 2 -> 3 -> 0
76-
for (int k = 0; k < cycleLength; k++) {
77-
String key = Integer.toString(k);
78-
String value = Integer.toString((k + 1) % cycleLength);
79-
80-
for (Database db : dbs) {
81-
db.run(tr -> {
76+
for (Database db : dbs) {
77+
db.run(tr -> {
78+
for (int k = 0; k < cycleLength; k++) {
79+
String key = Integer.toString(k);
80+
String value = Integer.toString((k + 1) % cycleLength);
8281
tr.set(Tuple.from(key).pack(), Tuple.from(value).pack());
83-
return null;
84-
});
85-
}
82+
}
83+
return null;
84+
});
8685
}
8786
}
8887

0 commit comments

Comments
 (0)