(t *testing.T)
| 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 | |
| 190 | func 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 | })) |
nothing calls this directly
no test coverage detected
searching dependent graphs…