Skip to content

Conversation

@yim-lee
Copy link
Member

@yim-lee yim-lee commented Dec 25, 2019

Address review comments in #311.

@yim-lee yim-lee requested a review from ktoso December 25, 2019 19:45
// No leader so singleton is not available, messages sent should be stashed
ref2.tell(.greet(name: "Charlie-2", _replyTo: replyProbe2.ref))
ref3.tell(.greet(name: "Charlie-3", _replyTo: replyProbe2.ref))
ref3.tell(.greet(name: "Charlie-3", _replyTo: replyProbe3.ref))
Copy link
Member Author

@yim-lee yim-lee Dec 25, 2019

Choose a reason for hiding this comment

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

bug 🙀

I don't know how the test was passing locally for me (with ActorTestKit(system), it started failing always when I changed to self.testKit(system))...

Copy link
Member

Choose a reason for hiding this comment

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

whoa! typo indeed... 😄

Copy link
Member

Choose a reason for hiding this comment

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

huh yeah unexpected that this had worked 🤔
Good catch!

if leaderNode != expectedNode {
throw testKit.error("Expected \(reflecting: expectedNode) to be leader node on \(reflecting: system.cluster.node) but was [\(reflecting: leaderNode)]")
}
}
Copy link
Member

Choose a reason for hiding this comment

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

👍 nice addition


override func tearDown() {
self.logCaptureHandler.printIfFailed(self.testRun)
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Good improvements thanks!
Technically "tiny race" remains I believe -- the cluster may know already that we're leaderless but the singleton may still receive the message we send it before it gets the info that it is leaderless. This definitely improves robustness of this test though - Thanks!

@ktoso ktoso merged commit e66319c into apple:master Dec 26, 2019
@ktoso ktoso deleted the singleton-feedback branch December 26, 2019 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants