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

Function TestFetchStatsHTTPError

fbclock/daemon/datafetcher_http_test.go:186–197  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

184 // gm_present=0 means ClockAccuracyNS should be 0
185 require.Equal(t, float64(0), dp.ClockAccuracyNS)
186 require.Equal(t, -50.5, dp.MasterOffsetNS)
187 require.Equal(t, 100.0, dp.PathDelayNS)
188}
189
190func TestFetchStatsSpikeFilteredGM(t *testing.T) {
191 // What sptp publishes while its servo filters an offset spike: the
192 // grandmaster it steers to, with this tick's measurement withheld.
193 sampleResp := `
194[
195 {"gm_address": "::1", "selected": true, "priority3": 1, "gm_present": 0, "servo_state": 3, "error": "Measurement is missing on RunResult"}
196]
197`
198 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
199 fmt.Fprintln(w, sampleResp)
200 }))

Callers

nothing calls this directly

Calls 3

FetchStatsMethod · 0.95
CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…