()
| 207 | } |
| 208 | |
| 209 | public void testSimple() { |
| 210 | runRaftServer(1_000); |
| 211 | |
| 212 | leftSendAddLogCount += 10; |
| 213 | concurrentSendCount = 4; |
| 214 | |
| 215 | runRaftServer(2_000); |
| 216 | |
| 217 | for (Env env : envs) |
| 218 | env.traceInfo("TEST END: " + env); |
| 219 | |
| 220 | if (!sendingSerials.isEmpty()) |
| 221 | throw new IllegalStateException("sendingSerials.size=" + sendingSerials.size()); |
| 222 | if (leftSendAddLogCount != 0) |
| 223 | throw new IllegalStateException("leftSendAddLogCount=" + leftSendAddLogCount); |
| 224 | for (Env env : envs) { |
| 225 | if (env.getRaft().getCommitIndex() != serialCounter - 1) |
| 226 | throw new IllegalStateException("unmatched commitIndex for id=" + env.id); |
| 227 | } |
| 228 | System.out.println("CHECK OK!"); |
| 229 | } |
| 230 | |
| 231 | public static void main(String[] args) { |
| 232 | new RaftTest().testSimple(); |
no test coverage detected