summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-24 10:31:44 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-24 10:31:44 +0100
commit3e50334e2233b7180b9895d106074aad914ca412 (patch)
treeb1907f986b80ef04703bd78eab0836a77b791e60
parent74a64fba47bb8000f4caba6e836a2824f677ee03 (diff)
Add failing Paxos test.
Fails because proposers do not retry.
-rw-r--r--same/src/test/java/com/orbekk/paxos/PaxosServiceFunctionalTest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/same/src/test/java/com/orbekk/paxos/PaxosServiceFunctionalTest.java b/same/src/test/java/com/orbekk/paxos/PaxosServiceFunctionalTest.java
index 8f20273..757d27c 100644
--- a/same/src/test/java/com/orbekk/paxos/PaxosServiceFunctionalTest.java
+++ b/same/src/test/java/com/orbekk/paxos/PaxosServiceFunctionalTest.java
@@ -19,7 +19,8 @@ public class PaxosServiceFunctionalTest {
RpcHandler handler = new RpcHandler(null);
TestServer server;
String myUrl;
-
+ int successfulProposals = 0;
+
@Before
public void setUp() throws Exception {
server = TestServer.create(handler);
@@ -55,7 +56,9 @@ public class PaxosServiceFunctionalTest {
MasterProposer client =
new MasterProposer("http:/client" + j, paxosUrls,
connections);
- client.propose(1, 1);
+ if (client.propose(1, 1)) {
+ incrementSuccessfulProposals();
+ }
}
});
}
@@ -69,8 +72,13 @@ public class PaxosServiceFunctionalTest {
// Ignore.
}
}
+ assertEquals(1, successfulProposals);
}
+ public synchronized void incrementSuccessfulProposals() {
+ successfulProposals += 1;
+ }
+
public static class TestServer {
public Server server;
public int port;