Skip to content

COR-173 - Test IMAP idle interruption - #109

Merged
dbezverkhnii merged 1 commit into
spark2from
test/COR-173-imap-idle-interruption
Sep 7, 2026
Merged

COR-173 - Test IMAP idle interruption#109
dbezverkhnii merged 1 commit into
spark2from
test/COR-173-imap-idle-interruption

Conversation

@dbezverkhnii

@dbezverkhnii dbezverkhnii commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Test-only changes with no production MailCore behavior modified; CI impact is limited to Darwin test runs.

Overview
Adds Darwin-only XCTest coverage for IMAP IDLE teardown, ported from upstream’s test-imap-idle.cpp “cancel wakes IDLE” scenario (the disconnect race half is omitted because the Swift API lacks the synchronous C++ session).

A local FakeIdleIMAPServer (POSIX listening socket on 127.0.0.1) drives MCOIMAPSession through LOGIN/LIST/SELECT into IDLE and observes DONE/close. Tests run work off the main thread so MailCore’s main-queue operation lifecycle can proceed.

testInterruptIdleEndsRunningIdle asserts that interruptIdle() ends a running IDLE and the server sees DONE.

testCancelAllOperationsWakesRunningIdle asserts that cancelAllOperations() should wake a blocked IDLE; it is wrapped in XCTExpectFailure until upstream merges the fix where IMAPIdleOperation::cancel() calls interruptIdle(), with cleanup via interruptIdle() when the expectation is not met.

Package.swift registers IMAPIdleCancellationTests.swift in the MailCoreTests target.

Reviewed by Cursor Bugbot for commit 2f5ba01. Bugbot is set up for automated code reviews on this repo. Configure here.

@dbezverkhnii
dbezverkhnii merged commit 5b37115 into spark2 Sep 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant