mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
Make isolated execute on async testing eventloop actually run (#3116)
Motivation: The isolated execute on async testing event loop wouldn't execute tasks in the case of promise being nil Modifications: Rewrite the execute logic slightly. Result: Correct execution Co-authored-by: George Barnett <gbarnett@apple.com>
This commit is contained in:
1 parent
42bea78572
commit
f46998ce2d
2 files changed
+5
-2
No files matched your search
@@ -146,7 +146,8 @@ public final class NIOAsyncTestingEventLoop: EventLoop, @unchecked Sendable {
|
||||
task: {
|
||||
do {
|
||||
// UnsafeUnchecked is acceptable because we know we're in the loop here.
|
||||
promise?.assumeIsolatedUnsafeUnchecked().succeed(try task())
|
||||
let result = try task()
|
||||
promise?.assumeIsolatedUnsafeUnchecked().succeed(result)
|
||||
} catch let err {
|
||||
promise?.fail(err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user