From 4a23d33c97e6c7f6d9e151f0aa170bbcb584c600 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Tue, 20 Mar 2018 23:58:59 +0900 Subject: [PATCH] Ensure we wait for the promise to succeed. (#200) Motivation: If we don't wait for the promise to succeed it may not be succeded before we tear the loop down. This causes precondition failures. Modifications: We now always wait for the promise to succeed. Result: My tests will run. --- Tests/NIOTests/ChannelNotificationTest.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/NIOTests/ChannelNotificationTest.swift b/Tests/NIOTests/ChannelNotificationTest.swift index 4acc587660..af6cefbb6a 100644 --- a/Tests/NIOTests/ChannelNotificationTest.swift +++ b/Tests/NIOTests/ChannelNotificationTest.swift @@ -391,6 +391,7 @@ class ChannelNotificationTest: XCTestCase { try clientChannel.writeAndFlush(buffer).then { clientChannel.close() }.wait() + try promise.futureResult.wait() try clientChannel.closeFuture.wait() try serverChannel.close().wait()