MCPcopy Create free account
hub / github.com/e2wugui/zeze / testSimple

Method testSimple

ZezeJava/ZezeJavaTest/src/SimpleRaft/RaftTest.java:209–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

mainMethod · 0.45

Calls 6

runRaftServerMethod · 0.95
traceInfoMethod · 0.65
isEmptyMethod · 0.65
sizeMethod · 0.65
getCommitIndexMethod · 0.45
getRaftMethod · 0.45

Tested by

no test coverage detected