fix: an asleep browser Lane is not a stalled one on the admin page
laneRow.Stalled was Due > 0 && Checked == 0, which is exactly the shape of the on-demand wake gate declining to start Chrome (ADR-0005): under five due Series and none overdue by 15m, a browser Lane reads nothing on purpose. kagane and novelfull each have one bookmarked Series, so that is their state for most of every cycle and the page marked both "not checking" — spending the one mark that means "go look" on the commonest healthy state. LaneState.Asleep is set at the wake gate, excluded from Stalled, kept out of Attention, and rendered as "browser asleep". Verified in prod: those Lanes wake on the age rule 15m past due (kagane and novelfull both polled at 14:55Z for a 14:40Z due moment, novelfull picking up Chapter 4458).
This commit is contained in:
@@ -776,6 +776,37 @@ func TestAdminPageShowsLaneStatus(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// A browser Lane under both wake thresholds holds Chrome asleep (ADR-0005), so
|
||||
// Series due with none checked is the design working, not a stopped Lane. The
|
||||
// two must not render the same mark: "not checking" is the owner's cue to go
|
||||
// looking, and spending it on the commonest healthy browser-Lane state trains
|
||||
// them to ignore it.
|
||||
func TestAsleepBrowserLaneIsNotMarkedStalled(t *testing.T) {
|
||||
lanes := fakeLanes{latest.Status{
|
||||
Lanes: []latest.LaneState{
|
||||
{Site: "kagane", Due: 1, LastRun: time.Now(), Gap: 10 * time.Second, Browser: true, Asleep: true},
|
||||
},
|
||||
BrowserConfigured: true,
|
||||
BrowserReachable: true,
|
||||
}}
|
||||
router, st, _ := oauthWebTestServer(t, lanes)
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/ui/admin/lanes", nil)
|
||||
req.AddCookie(sessionCookie(t, st))
|
||||
rr := httptest.NewRecorder()
|
||||
router.ServeHTTP(rr, req)
|
||||
body := rr.Body.String()
|
||||
if strings.Contains(body, "not checking") {
|
||||
t.Errorf("an asleep browser Lane is marked as stalled:\n%s", body)
|
||||
}
|
||||
if !strings.Contains(body, "browser asleep") {
|
||||
t.Errorf("an asleep browser Lane says nothing about why it read nothing:\n%s", body)
|
||||
}
|
||||
if strings.Contains(body, `class="attention"`) {
|
||||
t.Errorf("an asleep browser Lane is coloured as unhealthy:\n%s", body)
|
||||
}
|
||||
}
|
||||
|
||||
// A Lane whose pass never reached a figure must not have that figure drawn as
|
||||
// a zero: a refusing Lane still reports the due count and gap its last real
|
||||
// pass saw, and a Lane that has never reached one omits it entirely.
|
||||
|
||||
Reference in New Issue
Block a user