MCPcopy Create free account
hub / github.com/facebook/time / TestDaemonStateLinearizabilityRing

Function TestDaemonStateLinearizabilityRing

fbclock/daemon/daemon_test.go:55–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func TestDaemonStateLinearizabilityRing(t *testing.T) {
56 s := newDaemonState(3)
57
58 probes := []linearizability.TestResult{
59 linearizability.PTPTestResult{
60 Server: "server01",
61 TXTimestamp: time.Unix(0, 1647359186979431100),
62 RXTimestamp: time.Unix(0, 1647359186979431635),
63 },
64 linearizability.PTPTestResult{
65 Server: "server02",
66 TXTimestamp: time.Unix(0, 1647359186979431200),
67 RXTimestamp: time.Unix(0, 1647359186979431735),
68 },
69 linearizability.PTPTestResult{
70 Server: "server01",
71 TXTimestamp: time.Unix(0, 1647359186979431300),
72 RXTimestamp: time.Unix(0, 1647359186979431835),
73 },
74 }
75
76 for _, tr := range probes {
77 s.pushLinearizabilityTestResult(tr)
78 }
79 got := s.takeLinearizabilityTestResult(3)
80 require.ElementsMatch(t, probes, got)
81}
82
83func TestDaemonStateAggregateMax(t *testing.T) {
84 s := newDaemonState(3)

Callers

nothing calls this directly

Calls 4

newDaemonStateFunction · 0.85
UnixMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…