hub 0.177.0: Reboot guest on the host page (D65 = A, reboot_guest in the agent's closed list, 30-minute expiry); R-1346: the slow-request line and the vouch save's per-leg timing
gates / gates (push) Successful in 1m52s
gates / gates (push) Successful in 1m52s
This commit is contained in:
1 parent
dd3e4137ee
commit
636022dc31
10 files changed
+223
-16
No files matched your search
@@ -1,9 +1,12 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -80,3 +83,19 @@ func TestVouchGoldenChangedToOlderIsStillRefused(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// R-1346: a vouch save names the time of each leg in one line, so the next slow save says where its time went.
|
||||
// RED-PROOF: drop the timing line → FAILS.
|
||||
func TestVouchSaveLogsItsTiming(t *testing.T) {
|
||||
s, st := newTestServer(t)
|
||||
var logs bytes.Buffer
|
||||
s.logger = log.New(&logs, "", 0)
|
||||
seedReport(t, st, "demo", "0.335.0")
|
||||
w := postArtifacts(t, s, url.Values{"agent_version": {"0.160.0"}, "agent_sha256": {strings.Repeat("c", 64)}})
|
||||
if loc := w.Header().Get("Location"); !strings.Contains(loc, "flash=artifacts_set") {
|
||||
t.Fatalf("vouch refused: %q", loc)
|
||||
}
|
||||
if !regexp.MustCompile(`artifact vouch timing \(R-1346\): registry probes \d+ms, sha lookups \d+ms, bundle sha \d+ms, fleet check \+ save \d+ms, total \d+ms`).MatchString(logs.String()) {
|
||||
t.Fatalf("no timing line:\n%s", logs.String())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user