Skip to content

Conversation

@glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Mar 28, 2025

No description provided.

@glbrntt glbrntt added the semver/none No version bump required. label Mar 28, 2025
@glbrntt glbrntt requested a review from gjcairo March 28, 2025 08:39
channel.eventLoop.makeFailedFuture(MultiplexerTestError.rejected)
channel.eventLoop.makeCompletedFuture {
let sync = channel.pipeline.syncOperations
try sync.addHandler(errorLogger)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: any reason we need sync variable? why not just chain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason beyond habit!

// Issue a write to the child.
var bytes = channel.allocator.buffer(capacity: 1024)
bytes.writeString("Hello from the unit tests")
XCTAssertThrowsError(try channel.writeAndFlush(SSHChannelData(type: .channel, data: .byteBuffer(bytes))).wait())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to rewrite this because of "non-sendable" warning on SSHChannelData? My PR should address this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll fix these up.

buffer.writeString("Hello from the unit tests!")

for _ in 0..<5 {
channel.write(SSHChannelData(type: .channel, data: .byteBuffer(buffer)), promise: nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

let finalWriteComplete = NIOLoopBoundBox(false, eventLoop: channel.eventLoop)
let eofComplete = NIOLoopBoundBox(false, eventLoop: channel.eventLoop)

channel.write(SSHChannelData(type: .channel, data: .byteBuffer(buffer))).whenSuccess {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

// Now write some data. This fails immediately.
XCTAssertThrowsError(
try channel.write(
SSHChannelData(type: .channel, data: .byteBuffer(channel.allocator.buffer(capacity: 1024)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Contributor

@artemredkin artemredkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coulpe of minor suggestions but otherwise looks good

channel.eventLoop.makeFailedFuture(MultiplexerTestError.rejected)
channel.eventLoop.makeCompletedFuture {
let sync = channel.pipeline.syncOperations
try sync.addHandler(errorLogger)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason beyond habit!

// Issue a write to the child.
var bytes = channel.allocator.buffer(capacity: 1024)
bytes.writeString("Hello from the unit tests")
XCTAssertThrowsError(try channel.writeAndFlush(SSHChannelData(type: .channel, data: .byteBuffer(bytes))).wait())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll fix these up.

@glbrntt glbrntt enabled auto-merge (squash) March 31, 2025 13:19
@glbrntt glbrntt merged commit 6ec9ca0 into apple:main Mar 31, 2025
28 checks passed
@glbrntt glbrntt deleted the strict-concurrency-tests branch March 31, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants