Caught up is an equality, not an ordering
The report carries the digest of the declaration it applied (mesh-host 8211d8b), and the mesh stores it beside the outcome. `reported` rows in the status JSON now say `current`: whether the machine's last word names the declaration last sent. Not derivable from the timestamps beside it, which is why they were not enough: an apply begun under the previous declaration reports after the next send — newer, and still about the old words. The lab lost exactly that race between one test's closing push and the next test's opening one. Empty digests — every host from before reports carried one — read as not current, which errs toward waiting rather than toward asserting on files that are not there yet.
This commit is contained in:
@@ -64,6 +64,10 @@ type machineReported struct {
|
||||
Outcome string `json:"outcome"`
|
||||
At *time.Time `json:"at,omitempty"`
|
||||
Sent *time.Time `json:"sent,omitempty"`
|
||||
// Current is whether the last report names the declaration last sent. Not derivable from
|
||||
// the timestamps beside it: an apply begun under the previous declaration reports after the
|
||||
// next send, newer and still about the old words.
|
||||
Current bool `json:"current"`
|
||||
}
|
||||
|
||||
type machineWaiting struct {
|
||||
@@ -98,7 +102,7 @@ func statusAsJSON(wrong []inventory.Doing, nodes []inventory.Node, quiet []inven
|
||||
Reported: []machineReported{}}
|
||||
for _, r := range reported {
|
||||
out.Reported = append(out.Reported, machineReported{
|
||||
Node: r.Node, Outcome: r.Outcome, At: r.At, Sent: r.Sent})
|
||||
Node: r.Node, Outcome: r.Outcome, At: r.At, Sent: r.Sent, Current: r.Current})
|
||||
}
|
||||
|
||||
for _, m := range waiting {
|
||||
|
||||
Reference in New Issue
Block a user