Skip to content

Commit

Permalink
-test remove known flaky test of unsupported feature (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoso authored Oct 27, 2022
1 parent 7b8017c commit d816a10
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions Tests/DistributedClusterTests/InterceptorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,44 +166,6 @@ final class InterceptorTests: SingleClusterSystemXCTestCase {
}
}

func test_interceptor_shouldInterceptSignals() throws {
let p: ActorTestProbe<_Signals.Terminated> = self.testKit.makeTestProbe()

let spyOnTerminationSignals: _Interceptor<String> = TerminatedInterceptor(probe: p)

let spawnSomeStoppers = _Behavior<String>.setup { context in
let one: _ActorRef<String> = try context._spawnWatch(
"stopperOne",
.receiveMessage { _ in
.stop
}
)
one.tell("stop")

let two: _ActorRef<String> = try context._spawnWatch(
"stopperTwo",
.receiveMessage { _ in
.stop
}
)
two.tell("stop")

return .same
}

let _: _ActorRef<String> = try system._spawn(
"theWallsHaveEarsForTermination",
.intercept(behavior: spawnSomeStoppers, with: spyOnTerminationSignals)
)

// either of the two child actors can cause the death pact, depending on which one was scheduled first,
// so we have to check that the message we get is from one of them and afterwards we should not receive
// any additional messages
let terminated = try p.expectMessage()
(terminated.id.name == "stopperOne" || terminated.id.name == "stopperTwo").shouldBeTrue()
try p.expectNoMessage(for: .milliseconds(500))
}

class SignalToStringInterceptor<Message: Codable>: _Interceptor<Message> {
let probe: ActorTestProbe<String>

Expand Down

0 comments on commit d816a10

Please sign in to comment.