MCPcopy
hub / github.com/chaozh/MIT-6.824 / TestBasicAgree2B

Function TestBasicAgree2B

src/raft/test_test.go:122–143  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestBasicAgree2B(t *testing.T) {
123 servers := 3
124 cfg := make_config(t, servers, false, false)
125 defer cfg.cleanup()
126
127 cfg.begin("Test (2B): basic agreement")
128
129 iters := 3
130 for index := 1; index < iters+1; index++ {
131 nd, _ := cfg.nCommitted(index)
132 if nd > 0 {
133 t.Fatalf("some have committed before Start()")
134 }
135
136 xindex := cfg.one(index*100, servers, false)
137 if xindex != index {
138 t.Fatalf("got index %v but expected %v", xindex, index)
139 }
140 }
141
142 cfg.end()
143}
144
145//
146// check, based on counting bytes of RPCs, that

Callers

nothing calls this directly

Calls 6

nCommittedMethod · 0.80
oneMethod · 0.80
make_configFunction · 0.70
cleanupMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected