summaryrefslogtreecommitdiff
path: root/internal/daemon/daemon_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/daemon/daemon_test.go')
-rw-r--r--internal/daemon/daemon_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/daemon/daemon_test.go b/internal/daemon/daemon_test.go
index 60c6afa..ccc186e 100644
--- a/internal/daemon/daemon_test.go
+++ b/internal/daemon/daemon_test.go
@@ -316,6 +316,22 @@ func TestRunEmptyAddr(t *testing.T) {
}
}
+func TestNewDaemonHTTPServerTimeouts(t *testing.T) {
+ s := newDaemonHTTPServer("127.0.0.1:0", http.NotFoundHandler(), nil)
+ if g, w := s.ReadHeaderTimeout, 10*time.Second; g != w {
+ t.Fatalf("ReadHeaderTimeout %v want %v", g, w)
+ }
+ if g, w := s.ReadTimeout, 2*time.Minute; g != w {
+ t.Fatalf("ReadTimeout %v want %v", g, w)
+ }
+ if g, w := s.WriteTimeout, 2*time.Minute; g != w {
+ t.Fatalf("WriteTimeout %v want %v", g, w)
+ }
+ if g, w := s.IdleTimeout, 2*time.Minute; g != w {
+ t.Fatalf("IdleTimeout %v want %v", g, w)
+ }
+}
+
func TestRunWritesDaemonListenToLogOutput(t *testing.T) {
var buf syncBuffer
ctx, cancel := context.WithCancel(context.Background())