-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SR-1872 Using RunLoopSource in XCTestCase.waitForExpectations #304
SR-1872 Using RunLoopSource in XCTestCase.waitForExpectations #304
Conversation
Could not compile on Windows :( I guess it is because CF is private to Foundation on Win platform. |
@lxbndr Thanks for pointing the issue. Could you please direct me in which way I should Proceed
|
@pranavshenoy I'd choose p.2, as it looks problematic to write decent wrappers. AFAIK CFRunLoopSource doesn't have any Foundation counterparts. Maybe we should implement p.2 as part of this PR, and then address Windows specifics as separate patch. @compnerd would you like to recommend something here? |
CC @millenomi |
That PR is now out: swiftlang/swift-corelibs-foundation#2807 XCTest is cleared to use these wrappers, and as a change of policy You want something like: let source = RunLoop._Source()
runLoop._add(source, in: .default)
…
source.signal()
…
source.invalidate() |
To be clear, no one else is cleared to use them unless they talk to me first, so I can track changes if we need to change it. Edit: meaning: no other project than XCTest. |
The SPI has been merged. Go ahead. |
@millenomi I used wrapper but when I ran the tests, it was crashing.. Tried debugging it. The crash was occuring during _add() method.. On further analysis, got to know that crash is due to the hash closure in context definition
I passed nil for "hash:" argument and the tests succeeded.. |
I’ll take that patch. I’m sure it’s a memory management timing issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to run the tests on Windows. Now that a few other things have been cleaned up, I think that I will try to actually get the XCTest test suite enabled on Windows for regular testing. It previously was passing but was not part of the nightly runs.
@compnerd shouldn't the issue (unable to add source using _add() ) be fixed before testing on Windows? Or is the patch already merged? cc: @millenomi |
Ah, okay, Ill hold off until you give me the green light :) |
Thanks @compnerd . I will locally run the Functional tests once @millenomi 's patch is merged to Foundation. |
@millenomi Is there anything that I can do in this patch fix? please let me know. |
@millenomi Is there anything that I can do in this patch fix? please let me know. |
@compnerd I have been trying to figure out if I could fix the issue with changes in Foundation framework done for this PR. (Adding CFRunloop api wrapper in Runloop.swift ).. To give a recap, the issue
I couldn't get any documentation regarding what the hash closure is expecting. Most examples I went through were having nil as the value.. can you tell me if I can pass nil to the hash argument and raise the PR to foundation framework? Or is there any way that we could fix that issue? |
@millenomi @compnerd I guess i got why its crashing..
In some cases, me.hashValue is negative value where the argument for CFHashCode is supposed to be unsigned integer.. I tried passing some positive number and it worked... |
@swift-ci please test |
If I can, I'm going to have a patch today for the crasher. |
Thank you.. I will locally run the functional tests to make sure all tests
are passing for my changes.
*Thanks and Regards*
*Pranav*
…On Thu, Aug 20, 2020 at 10:06 PM Lily Vulcano ***@***.***> wrote:
If I can, I'm going to have a patch today for the crasher.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#304 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADELZGDX5HEQJGD3YHQCY23SBVGJBANCNFSM4NJ74IWA>
.
|
This should fix your |
@swift-ci please test |
The Swift project moved the default branch to More detail about the branch update - https://forums.swift.org/t/updating-branch-names/40412 |
SR-1872 Replacing polling expectations to check whether an expectation is fulfilled with RunloopSource