-
Notifications
You must be signed in to change notification settings - Fork 712
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] ReconnectBufSize() Option function #340
Conversation
This creates a function one can use to set the ReconnectBufSize option, it's similar in design to the other functions already here Also makes small fixes to some doc strings that I noticed
test failure does not appear to be my doing :) |
I have recycled the test. Would you mind adding a test so that code coverage shows that this function was invoked? It could be as simple as creating a connection with that option and then checking that the internal reconnect buffer size matches what you have set. |
OK - I did check, none of these others are tested, but sure. |
From coverall, it seems that they are since they show in green. Keep in mind that there are tests in |
indeed, I saw there's a |
Thanks, but that is really to make coverall happy. Could you instead look at test |
erm, I guess, though not really experienced with go's built in test framework, will have to wait for another day as that's all i had time for today |
Thanks for the submission, this would be helpful. We do require tests though. |
yup, will look at test tomorrow |
test/conn_test.go
Outdated
@@ -700,7 +700,9 @@ func TestCallbacksOrder(t *testing.T) { | |||
nats.ClosedHandler(cch), | |||
nats.ErrorHandler(ech), | |||
nats.ReconnectWait(50*time.Millisecond), | |||
nats.DontRandomize()) | |||
nats.DontRandomize(), | |||
nats.ReconnectBufSize(10*1024)) |
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.
Since you added a specific test, you may want to revert this change.
@kozlovic looks like reworking that test into a table test is quite an undertaking - but as per your earlier suggestion the thing to test is if the option gets set or not, since that other test makes sure that the rest of the code does with whatever was set. So I reckon this is sufficient to test the functionality of the Option. There appears to be some weirdness, maybe something in my environments but these tests panic for me on timeout - even before my changes. But seems ok on travis :) |
@ripienaar You may have a server running outside of the test suite... |
LGTM |
ok, let me know if there's anything else, but that'll be for tomorrow, thanks! |
Thanks! @kozlovic will merge. |
Thanks for the contribution! |
This creates a function one can use to set the ReconnectBufSize option,
it's similar in design to the other functions already here
Also makes small fixes to some doc strings that I noticed