diff --git a/internal/file_watcher/file_watcher_test.go b/internal/file_watcher/file_watcher_test.go index 1dd3ddb..cc619fc 100644 --- a/internal/file_watcher/file_watcher_test.go +++ b/internal/file_watcher/file_watcher_test.go @@ -23,7 +23,7 @@ func TestFileWatcher(t *testing.T) { t.Fatalf("failed to create file watcher: %v", err) } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(testTimeout)) defer cancel() go func() { @@ -56,7 +56,7 @@ func TestFileWatcher(t *testing.T) { t.Fatalf("failed to create file watcher: %v", err) } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(testTimeout)) defer cancel() go func() { @@ -87,7 +87,7 @@ func TestFileWatcher(t *testing.T) { t.Fatalf("failed to create file watcher: %v", err) } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(testTimeout)) defer cancel() go func() {