-
Notifications
You must be signed in to change notification settings - Fork 25
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
RSC15a as a part of 0.9 #501
Conversation
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.
LGTM 👍
expect(resultFallbackHosts).to(equal(expectedFallbackHosts)) | ||
} | ||
|
||
it("until httpMaxRetryCount has been reached, if an empty array of fallback hosts is provided, then fallback host functionality is disabled, use defaults instead") { |
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.
I don't think is right. If an empty array or fallback hosts is configured, then according to http://docs.ably.io/client-lib-development-guide/features/#RSC15a, If an empty array of fallback hosts is provided, then fallback host functionality is disabled
. It appears that you are instead using the defaults?
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.
Sorry, I see this is fixed in b0ae3c6
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.
I see this is fixed in b0ae3c6
Yes, exactly, thanks for feedback.
expect(resultFallbackHosts).to(equal(expectedFallbackHosts)) | ||
} | ||
|
||
it("until all fallback hosts have been tried, if an empty array of fallback hosts is provided, then fallback host functionality is disabled, use defaults instead") { |
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.
Same problem here, it appears you are using the defaults instead of disabling the fallback functionality
0f4462f
to
94426c2
Compare
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.
One small comment otherwise 👍
|
||
it("until httpMaxRetryCount has been reached, if custom fallback hosts are provided in ClientOptions#fallbackHosts, then they will be used instead") { | ||
let options = ARTClientOptions(key: "xxxx:xxxx") | ||
options.httpMaxRetryCount = 5 |
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.
Given you've provided 5, why not set this to 4 for example to ensure that httpMaxRetryCount is working as opposed to the max of hosts available is being used?
Please review and merge if everything looks good. |
@mattheworiordan could you please find some spare time to take a look at 1cef166 ? |
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.
Like the reduce in retry count but not sure I understand the test logic now using fallbackHosts when the max retry count is the definitive number of retry attempts?
@@ -839,6 +839,7 @@ class RestClient: QuickSpec { | |||
} | |||
|
|||
expect(testHTTPExecutor.requests).to(haveCount(Int(1 + options.httpMaxRetryCount))) | |||
expect((testHTTPExecutor.requests.count) < (_fallbackHosts.count + 1)).to(beTrue()) |
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.
Why not expect(testHTTPExecutor.requests).to(haveCount(Int(1 + options.httpMaxRetryCount)))
though?
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.
Agree, I'm using local variable _fallbackHosts
and its count
property.
Assert based on that hard-coded array is useless, because who knows, how big an array can be.
If I use assert based on options.fallbackHosts.count
like that:
expect((testHTTPExecutor.requests.count) < (options.fallbackHosts.count + 1)).to(beTrue())
I can check that count of executed requests (which is 5 = 1 to primary host + 4 to fallback hosts, cuz I use httpMaxRetryCount = 4
value) is less than max available count (which is 6 = 1 to primary + 5 to fallback hosts).
So I just wanted to be sure that reduce in retry count from 5 to 4 - works as expected, does it make sense @mattheworiordan ?
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.
@EvgenyKarkan on that line you're checking the _fallbackHosts
, not the options.fallbackHosts
. You already verifying the number of requests of the testHTTPExecutor
and the _fallbackHosts
is a local var of the test suite that we control, so I think that line is useless.
…ed assert for that case.
674f32f
to
5f75cc8
Compare
Rebased and tests are passing. |
Please review and merge if everything looks good.