fix(imapx): honor context in Connect with bounded dial retry

This commit is contained in:
2026-07-01 17:28:10 +07:00
parent 0451b79c64
commit 79f5c5b93a
2 changed files with 37 additions and 11 deletions
+9
View File
@@ -40,3 +40,12 @@ func TestTestLoginListsFolders(t *testing.T) {
t.Fatalf("INBOX not in folders: %v", folders)
}
}
func TestConnectHonorsCancelledContext(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()
_, err := Connect(ctx, Endpoint{Host: "10.255.255.1", Port: 993, TLSMode: "ssl"})
if err == nil {
t.Fatal("expected error for cancelled context")
}
}