-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added tests for server & bi-directional streaming #183
Conversation
Thanks a lot for this, it's great to see more cases of the API's usage covered with tests. I'll leave a full review to @timburks (he's the maintainer and knows this portion of the code better). I think that it would be nicer to just have one or two extra test cases in Also, would you mind adapting your indentation to match the project's (2-spaces, no tabs)? Unfortunately, |
@@ -85,7 +85,7 @@ class GeneratorOptions { | |||
} | |||
|
|||
static func parseParameter(string: String?) -> [(key: String, value: String)] { | |||
guard let string = string, string.characters.count > 0 else { | |||
guard let string = string, string.isEmpty else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isEmpty condition should be inverted, i.e. it should be !string.isEmpty instead of string.isEmpty. Fortunately, our plugin test (make test-plugin
) caught it!
If you don't mind, please update that in your PR. When the tests pass, I'll merge it.
Thank you!
With the inverted guard condition fixed, I'm still seeing a test failure on Linux:
|
@timburks I cannot figure out what's going on here. There seems to be some sort of race condition, but nothing is standing out to me. I also cannot reproduce this error on OSX. |
@cvanderschuere Have you tested on Linux? I'll try to reproduce this in a Linux VM. |
@cvanderschuere I can confirm that the test fails on Ubuntu 16.04. The "ok" result is being set on this line which suggests that the operation group failed (and .ok should be something else, possibly .unknown). I'll continue investigating. Thanks for creating this test! |
@cvanderschuere I don't think this line does what your comment suggests that it will do. @MrMage recently added that queue and from reading Call.swift, I think it only synchronizes message sends and not call starts. Also, I think we need to add Update: the test seems to consistently pass for me when I delete |
@timburks Thanks for the help! I certainly misunderstood what I made the changes you suggested and all looks to be well. |
@cvanderschuere Thanks for working through this! |
Following up on #144, these tests verify that #147 fixed the problem.