MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestRunPeerListUpdater

Function TestRunPeerListUpdater

client/driver_test.go:337–368  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

335}
336
337func TestRunPeerListUpdater(t *testing.T) {
338 Convey("test peersUpdaterRunning", t, func() {
339 var stopTestService func()
340 var err error
341
342 err = runPeerListUpdater()
343 So(err, ShouldNotBeNil)
344
345 stopTestService, _, err = startTestService()
346 So(err, ShouldBeNil)
347 defer stopTestService()
348
349 // normal case
350 err = runPeerListUpdater()
351 So(err, ShouldBeNil)
352
353 // only one goroutine will be started
354 err = runPeerListUpdater()
355 So(err, ShouldBeNil)
356
357 var priv *asymmetric.PrivateKey
358 priv, err = kms.GetLocalPrivateKey()
359 So(err, ShouldBeNil)
360 dbID := proto.DatabaseID("db")
361
362 _, err = getPeers(dbID, priv)
363 So(err, ShouldBeNil)
364
365 time.Sleep(1 * time.Second)
366 stopPeersUpdater()
367 })
368}

Callers

nothing calls this directly

Calls 6

GetLocalPrivateKeyFunction · 0.92
DatabaseIDTypeAlias · 0.92
runPeerListUpdaterFunction · 0.85
startTestServiceFunction · 0.85
stopPeersUpdaterFunction · 0.85
getPeersFunction · 0.70

Tested by

no test coverage detected