diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2025-11-29 10:59:41 -0800 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2025-11-29 10:59:41 -0800 |
| commit | f96e805b5472c18eb8eef2bed178e150a3145ad2 (patch) | |
| tree | 037d0a68d69a0dea985ed24e7146a22c1a0a13fd /hotline/server_test.go | |
| parent | 6dae50a96f81527b039202c818b4acfdae658a55 (diff) | |
Ran goimports -w . to tidy up
Diffstat (limited to 'hotline/server_test.go')
| -rw-r--r-- | hotline/server_test.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/hotline/server_test.go b/hotline/server_test.go index 574aae7..db70480 100644 --- a/hotline/server_test.go +++ b/hotline/server_test.go @@ -5,13 +5,14 @@ import ( "context" "encoding/binary" "fmt" - "github.com/stretchr/testify/assert" "io" "log/slog" "os" "strings" "testing" "time" + + "github.com/stretchr/testify/assert" ) type mockReadWriter struct { @@ -400,20 +401,20 @@ func TestServer_registerWithTrackers(t *testing.T) { func TestServer_registerWithTrackers_ContextCancellation(t *testing.T) { tests := []struct { - name string - cancelAfter time.Duration - expectedCalls int // Number of expected registration calls before cancellation - trackerCount int + name string + cancelAfter time.Duration + expectedCalls int // Number of expected registration calls before cancellation + trackerCount int }{ { - name: "immediate cancellation", - cancelAfter: 10 * time.Millisecond, + name: "immediate cancellation", + cancelAfter: 10 * time.Millisecond, expectedCalls: 2, // Should complete immediate registration trackerCount: 2, }, { - name: "cancellation after first ticker", - cancelAfter: 100 * time.Millisecond, + name: "cancellation after first ticker", + cancelAfter: 100 * time.Millisecond, expectedCalls: 2, // Should only do immediate registration within 100ms trackerCount: 2, }, @@ -470,10 +471,10 @@ func TestServer_registerWithTrackers_ContextCancellation(t *testing.T) { func TestServer_registerWithTrackers_PeriodicRegistration(t *testing.T) { t.Skip("Skipping timing-sensitive test - would take 5+ minutes to run reliably") - + // This test would verify that periodic re-registration happens every trackerUpdateFrequency seconds // but it's impractical to run in normal test suites due to the 300-second interval - + mockRegistrar := &MockTrackerRegistrar{} config := Config{ EnableTrackerRegistration: true, |