Embassy icon indicating copy to clipboard operation
Embassy copied to clipboard

Embassy_iOSTests.KqueueSelectorTests testSelectMultipleSocke is failing

Open dagio opened this issue 7 years ago • 2 comments

The test Embassy_iOSTests.KqueueSelectorTests testSelectMultipleSocke is failing locally

Setup :

  • Mac OS 10.12.4
  • Xcode 8.3.1
  • Embassy v3.1.0
Test Case '-[Embassy_iOSTests.KqueueSelectorTests testSelectMultipleSocket]' started.
/Volumes/Develop/GitRepos/dagio/EmbassyStuck/Carthage/Checkouts/Embassy/Tests/EmbassyTests/KqueueSelectorTests.swift:225: error: -[Embassy_iOSTests.KqueueSelectorTests testSelectMultipleSocket] : XCTAssertEqual failed: ("[Embassy_iOSTests.FileDescriptorEvent(fileDescriptor: 42, ioEvent: Embassy.IOEvent.write), Embassy_iOSTests.FileDescriptorEvent(fileDescriptor: 44, ioEvent: Embassy.IOEvent.write)]") is not equal to ("[Embassy_iOSTests.FileDescriptorEvent(fileDescriptor: 42, ioEvent: Embassy.IOEvent.write), Embassy_iOSTests.FileDescriptorEvent(fileDescriptor: 44, ioEvent: Embassy.IOEvent.write), Embassy_iOSTests.FileDescriptorEvent(fileDescriptor: 44, ioEvent: Embassy.IOEvent.read)]") -
Test Case '-[Embassy_iOSTests.KqueueSelectorTests testSelectMultipleSocket]' failed (1.010 seconds).

This might be (??) the reason why -[DefaultHTTPServer stopAndWait] is stuck.

dagio avatar Apr 13 '17 16:04 dagio

@dagio

Hi Damien,

Thanks for reporting the issue, there is another issue open #31, it seems the hanging problem may have something to do with compiling option, I have no time to check it yet, but it would be nice if you can try different compiling option see if it works.

fangpenlin avatar May 04 '17 00:05 fangpenlin

I did a little bit of digging, at appears that KqueueSelector.select(timeout:) hangs in some cases, it hangs on calling kevent() with nil timeout, which means it should wait indefinitely for next kevent that never arrives. I'm having hard times understanding what is supposed to be a source for events to debug why are they never emitted. I can continue digging into that with some guidance.

gavrix avatar Feb 21 '18 22:02 gavrix