From 1d69ebaf58d0240742f9c86a5ce4c1303297a07b Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Wed, 8 Jul 2026 21:18:19 +0200 Subject: [PATCH] Additional test --- server/server_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/server_test.go b/server/server_test.go index 8b01d9e5..c2c6c763 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -3700,9 +3700,12 @@ func (b *slowBody) Close() error { return nil } func TestServer_MessageTemplate_SlowUpload_NotCountedAgainstDeadline(t *testing.T) { s := newTestServer(t, newTestConfig(t, "")) start := time.Now() + // The loop makes the template execute enough nodes (>256) to actually hit the deadline check, + // so this test distinguishes correct behavior from a deadline that includes upload time -- yet + // it runs in ~1ms, far under the deadline, so on correct code it renders fine. response := request(t, s, "POST", "/mytopic", `{"foo":"bar"}`, map[string]string{ "Template": "yes", - "X-Message": "hello {{.foo}}", + "X-Message": `{{range until 5000}}{{$x := .}}{{end}}hello {{.foo}}`, }, func(r *http.Request) { r.Body = &slowBody{data: []byte(`{"foo":"bar"}`), delay: 3 * templateMaxExecutionTime} })