You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check out the commit 1bc2552c3f7cb0d33080d65b1290008ac5342cdf
Comment out line 125 of /Sources/TCP/Server.swift and insert print statement there.
Insert a print statement in the cancelHandler on line 47 of the same file
Run the test RouterTests.testMiddleware
You should see that although the cancel in invoked, the test completes without ever invoking the cancel handler configured on line 47.
Shouldn't the listeningSource maintain a strong reference to the handler and submit it to the main queue (in this case) to be run when cancel is invoked or am I misunderstanding something about the contract of cancel?
Note: This is on macOS. I have not tested this for Linux.
The text was updated successfully, but these errors were encountered:
I'm unable to call dispatch_main directly inside an XCTest. I am, however, calling waitForExpectations which should have the same effect. waitForExpectations certainly works fine to schedule my other blocks to run on the main queue.
Additional Detail from JIRA
md5: 1641e42bfc66b37d5426aff6370cf49c
Issue Description:
It appears that the cancel handler is never invoked after calling cancel on a DispatchSource in Swift 3 on macOS.
This issue can be replicated by following steps with Swift 3.0.1.
You should see that although the cancel in invoked, the test completes without ever invoking the cancel handler configured on line 47.
Shouldn't the listeningSource maintain a strong reference to the handler and submit it to the main queue (in this case) to be run when cancel is invoked or am I misunderstanding something about the contract of cancel?
Note: This is on macOS. I have not tested this for Linux.
The text was updated successfully, but these errors were encountered: