-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Move to Go 1.5 #3863
Move to Go 1.5 #3863
Conversation
Fixes #3731 |
24cd3c1
to
5529327
Compare
@@ -517,8 +517,8 @@ func TestClient_Timeout(t *testing.T) { | |||
_, err = c.Query(query) | |||
if err == nil { | |||
t.Fatalf("unexpected success. expected timeout error") | |||
} else if !strings.Contains(err.Error(), "use of closed network connection") { | |||
t.Fatalf("unexpected error. expected 'use of closed network connection' error, got %v", err) | |||
} else if !strings.Contains(err.Error(), "request canceled") { |
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.
@corylanou -- please confirm that this is OK with you. I think the error must have changed in Go 1.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.
That's interesting. It appears to be a "better" error now. I don't remember reading anything in the release notes on it, but it's probably in their changelog. Seems fine. +1
@aviau -- scrap that. Can you please take a look at this build break, and tell me what you think is going on? It seems to think it's overwriting
|
I think this is #1486560. I could fix it like this:
|
I opened a PR. #3867 Lets wait for the build. |
From golang/go@516f0d1 "Note that we use a channel send here and not a close. The race detector doesn't know that we're waiting for a timeout and thinks that the waitgroup inside httptest.Server is added to concurrently with us closing it. If we timed out immediately, we could close the testserver before we entered the handler. We're not timing out immediately and there's no way we would be done before we entered the handler, but the race detector doesn't know this, so synchronize explicitly.
confignotimeout := client.Config{URL: *u} | ||
cnotimeout, err := client.NewClient(confignotimeout) | ||
_, err = cnotimeout.Query(query) | ||
func TestClient_NoTimeout(t *testing.T) { |
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.
TestClientTimeout
has been split into two tests.
Green build, ready to make the move to Go 1.5. |
+1 |
2 similar comments
+1 |
+1 |
This patch migrates InfluxDB to Go 1.5.
Very little had to change. The most significant change was to some unit test code, in which an interaction with Go's race detector was exposed. This was addressed using some explicit synchronization. The unit test was also split in two for clarity.
Only one small change to production code was required -- the explicit configuration of GOMAXPROCS.