Skip to content

Commit 3483b2a

Browse files
committed
Actually use the args to SASLConnectReconnect; shutdown nicely.
Change-Id: I7517a355707ed9440974d5b5b947fb13a8ba7142
1 parent 764b5b5 commit 3483b2a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/test/manual/net/spy/memcached/test/SASLConnectReconnect.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.IOException;
44
import java.net.InetSocketAddress;
55
import java.util.List;
6+
import java.util.concurrent.TimeUnit;
67
import java.util.logging.ConsoleHandler;
78
import java.util.logging.Handler;
89
import java.util.logging.Level;
@@ -95,7 +96,7 @@ public static void main(String[] args) throws InterruptedException {
9596
m.verifySetAndGet();
9697
System.err.println("Pass one done.");
9798
Thread.sleep(60000);
98-
m.verifySetAndGet2();
99+
m.verifySetAndGet2(Integer.parseInt(args[3]));
99100
System.err.println("Pass two done.");
100101

101102
}
@@ -118,10 +119,9 @@ public void verifySetAndGet() {
118119
/**
119120
* verify set and get go to the right place
120121
*/
121-
public void verifySetAndGet2() {
122+
public void verifySetAndGet2(int iterations) {
122123
try {
123-
int iterations = 50000;
124-
for (int i = 0; i < iterations; i++) {
124+
for (int i = 0; i <= iterations; i++) {
125125
mc.set("me" + i, 0, "me" + i);
126126
}
127127

@@ -137,6 +137,7 @@ public void verifySetAndGet2() {
137137
System.err.println("Operation timeed out, continuing.");
138138
}
139139
}
140+
mc.shutdown(1, TimeUnit.SECONDS);
140141
} catch (Exception ex) {
141142
System.err.println("Bailing out " + ex.toString() + "\n");
142143
ex.printStackTrace();

0 commit comments

Comments
 (0)