MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / TestReactorWithTimeoutCommit

Function TestReactorWithTimeoutCommit

consensus/reactor_test.go:561–577  ·  view source on GitHub ↗

Check we can make blocks with skip_timeout_commit=false

(t *testing.T)

Source from the content-addressed store, hash-verified

559
560// Check we can make blocks with skip_timeout_commit=false
561func TestReactorWithTimeoutCommit(t *testing.T) {
562 N := 4
563 css, cleanup := randConsensusNet(N, "consensus_reactor_with_timeout_commit_test", newMockTickerFunc(false), newCounter)
564 defer cleanup()
565 // override default SkipTimeoutCommit == true for tests
566 for i := 0; i < N; i++ {
567 css[i].config.SkipTimeoutCommit = false
568 }
569
570 reactors, blocksSubs, eventBuses := startConsensusNet(t, css, N-1)
571 defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
572
573 // wait till everyone makes the first new block
574 timeoutWaitGroup(t, N-1, func(j int) {
575 <-blocksSubs[j].Out()
576 }, css)
577}
578
579func waitForAndValidateBlock(
580 t *testing.T,

Callers

nothing calls this directly

Calls 8

TestingLoggerFunction · 0.92
randConsensusNetFunction · 0.85
newMockTickerFuncFunction · 0.85
cleanupFunction · 0.85
startConsensusNetFunction · 0.85
stopConsensusNetFunction · 0.85
timeoutWaitGroupFunction · 0.85
OutMethod · 0.65

Tested by

no test coverage detected