Skip to content
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

BaseSocketChannel: assert(self.lifecycleManager.isActive) hit when running NIO tests in sandbox #2465

Open
weissi opened this issue Jul 11, 2023 · 0 comments · May be fixed by #2616
Open

BaseSocketChannel: assert(self.lifecycleManager.isActive) hit when running NIO tests in sandbox #2465

weissi opened this issue Jul 11, 2023 · 0 comments · May be fixed by #2616
Labels
bug Something isn't working

Comments

@weissi
Copy link
Member

weissi commented Jul 11, 2023

I hit this assertion

assert(self.lifecycleManager.isActive)

when running the NIO tests in a tight sandbox. Output

     Test Suite 'All tests' started at 2023-07-11 05:46:11.149.
     Test Suite 'swift-nioPackageTests.xctest' started at 2023-07-11 05:46:11.153.
     Test Suite 'AcceptBackoffHandlerTest' started at 2023-07-11 05:46:11.154.
     Test Case '-[NIOPosixTests.AcceptBackoffHandlerTest testChannelInactiveCancelScheduled]' started.
     swift-nio/Tests/NIOPosixTests/AcceptBackoffHandlerTest.swift:268: error: -[NIOPosixTests.AcceptBackoffHandlerTest testChannelInactiveCancelScheduled] : XCTAssertNoThrow failed: threw error "bind(descriptor:ptr:bytes:): Operation not permitted (errno: 1)"
     NIOPosix/BaseSocketChannel.swift:1077: Assertion failed

The sandbox disallows bind and other network related stuff. So it's expected that the tests fail but I wouldn't expect an assertion to be hit.

This can probably be tested with the SAL (syscall abstraction layer) because that should make it easy to make bind fail with EPERM (== 1).

@weissi weissi added the bug Something isn't working label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant