From 8c8a55a737421133564db650c9d202dbb7923f59 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 30 May 2015 08:57:27 -0600 Subject: [PATCH] Removed 'failed' from test suite. --- client/influxdb_test.go | 8 ++--- cluster/coordinator_test.go | 6 ++-- cluster/writer_test.go | 2 +- cmd/influxd/run/server_test.go | 58 +++++++++++++++--------------- influxql/engine_test.go | 2 +- influxql/functions_test.go | 4 +-- meta/retention_policy_enforcer.go | 2 +- meta/shard_group_precreator.go | 2 +- services/admin/service.go | 2 +- services/graphite/graphite_tcp.go | 2 +- services/graphite/graphite_test.go | 8 ++--- services/graphite/graphite_udp.go | 2 +- services/httpd/handler.go | 4 +-- stats_test.go | 14 ++++---- 14 files changed, 58 insertions(+), 58 deletions(-) diff --git a/client/influxdb_test.go b/client/influxdb_test.go index b58f2d133b..d690d9a565 100644 --- a/client/influxdb_test.go +++ b/client/influxdb_test.go @@ -38,7 +38,7 @@ func BenchmarkUnmarshalJSON2Tags(b *testing.B) { for i := 0; i < b.N; i++ { if err := json.Unmarshal(data, &bp); err != nil { - b.Errorf("failed to unmarshal nanosecond data: %s", err.Error()) + b.Errorf("unable to unmarshal nanosecond data: %s", err.Error()) } b.SetBytes(int64(len(data))) } @@ -77,7 +77,7 @@ func BenchmarkUnmarshalJSON10Tags(b *testing.B) { for i := 0; i < b.N; i++ { if err := json.Unmarshal(data, &bp); err != nil { - b.Errorf("failed to unmarshal nanosecond data: %s", err.Error()) + b.Errorf("unable to unmarshal nanosecond data: %s", err.Error()) } b.SetBytes(int64(len(data))) } @@ -140,7 +140,7 @@ func TestClient_BasicAuth(t *testing.T) { u, p, ok := r.BasicAuth() if !ok { - t.Errorf("basic auth failed") + t.Errorf("basic auth error") } if u != "username" { t.Errorf("unexpected username, expected %q, actual %q", "username", u) @@ -493,6 +493,6 @@ func TestBatchPoints_Normal(t *testing.T) { `) if err := json.Unmarshal(data, &bp); err != nil { - t.Errorf("failed to unmarshal nanosecond data: %s", err.Error()) + t.Errorf("unable to unmarshal nanosecond data: %s", err.Error()) } } diff --git a/cluster/coordinator_test.go b/cluster/coordinator_test.go index e84ad65b91..879ba40673 100644 --- a/cluster/coordinator_test.go +++ b/cluster/coordinator_test.go @@ -129,7 +129,7 @@ func TestCoordinatorWrite(t *testing.T) { expErr: nil, }, { - name: "write one fail", + name: "write one error", consistency: cluster.ConsistencyLevelOne, err: []error{fmt.Errorf("a failure"), fmt.Errorf("a failure"), fmt.Errorf("a failure")}, expErr: cluster.ErrWriteFailed, @@ -189,7 +189,7 @@ func TestCoordinatorWrite(t *testing.T) { expErr: nil, }, - // Error write failed + // Error write error { name: "no writes succeed", consistency: cluster.ConsistencyLevelOne, @@ -252,7 +252,7 @@ func TestCoordinatorWrite(t *testing.T) { } if err := c.Write(pr); err != test.expErr { - t.Errorf("Coordinator.Write(): '%s' failed: got %v, exp %v", test.name, err, test.expErr) + t.Errorf("Coordinator.Write(): '%s' error: got %v, exp %v", test.name, err, test.expErr) } } } diff --git a/cluster/writer_test.go b/cluster/writer_test.go index 98daa43c16..dac74f1bd4 100644 --- a/cluster/writer_test.go +++ b/cluster/writer_test.go @@ -149,7 +149,7 @@ func Test_WriteShardRequestMultipleSuccess(t *testing.T) { t.Fatal("unexpected time") } } -func Test_WriteShardRequestFail(t *testing.T) { +func Test_WriteShardRequestError(t *testing.T) { var ( ts = newTestServer(writeShardFail) s = cluster.NewServer(ts, "127.0.0.1:0") diff --git a/cmd/influxd/run/server_test.go b/cmd/influxd/run/server_test.go index 779e26b7bf..358b956ab0 100644 --- a/cmd/influxd/run/server_test.go +++ b/cmd/influxd/run/server_test.go @@ -75,7 +75,7 @@ type Cluster []*TestNode func (c *Cluster) Close() { for _, n := range *c { if err := n.node.Close(); err != nil { - log.Fatalf("failed to close node: %s", err) + log.Fatalf("unable to close node: %s", err) } } } @@ -126,10 +126,10 @@ func createCombinedNodeCluster(t *testing.T, testName, tmpDir string, nNodes int s := baseNode.DataNode if b == nil { - t.Fatalf("Test %s: failed to create broker on port %d", testName, basePort) + t.Fatalf("Test %s: unable to create broker on port %d", testName, basePort) } if s == nil { - t.Fatalf("Test %s: failed to create leader data node on port %d", testName, basePort) + t.Fatalf("Test %s: unable to create leader data node on port %d", testName, basePort) } nodes = append(nodes, &TestNode{ node: baseNode, @@ -147,10 +147,10 @@ func createCombinedNodeCluster(t *testing.T, testName, tmpDir string, nNodes int cmd := main.NewRunCommand() node := cmd.Open(c, baseNode.ClusterURL().String()) if node.Broker == nil { - t.Fatalf("Test %s: failed to create following broker on addr %s", testName, node.ClusterURL().String()) + t.Fatalf("Test %s: unable to create following broker on addr %s", testName, node.ClusterURL().String()) } if node.DataNode == nil { - t.Fatalf("Test %s: failed to create following data node on addr %s", testName, node.ClusterURL().String()) + t.Fatalf("Test %s: unable to create following data node on addr %s", testName, node.ClusterURL().String()) } nodes = append(nodes, &TestNode{ @@ -167,7 +167,7 @@ func createCombinedNodeCluster(t *testing.T, testName, tmpDir string, nNodes int ids[int(n.node.DataNode.ID())] = true } if len(ids) != len(nodes) { - t.Fatalf("failed to create valid cluster. some data nodes have the same id: %v", ids) + t.Fatalf("unable to create valid cluster. some data nodes have the same id: %v", ids) } return nodes @@ -226,7 +226,7 @@ func write(t *testing.T, node *TestNode, data string) { } if resp.StatusCode != http.StatusNoContent { body, _ := ioutil.ReadAll(resp.Body) - t.Fatalf("Write to database failed. Unexpected status code. expected: %d, actual %d, %s", http.StatusNoContent, resp.StatusCode, string(body)) + t.Fatalf("Write to database error. Unexpected status code. expected: %d, actual %d, %s", http.StatusNoContent, resp.StatusCode, string(body)) } } @@ -244,7 +244,7 @@ func query(t *testing.T, nodes Cluster, urlDb, query, expected, expectPattern st u := urlFor(n.url, "query", v) resp, err := http.Get(u.String()) if err != nil { - t.Fatalf("Failed to execute query '%s': %s", query, err.Error()) + t.Fatalf("Unable to execute query '%s': %s", query, err.Error()) } defer resp.Body.Close() @@ -354,7 +354,7 @@ func runTest_rawDataReturnsInOrder(t *testing.T, testName string, nodes Cluster, expected = fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",%d]]}]}]}`, numPoints-1) got, ok, nOK := queryAndWait(t, nodes, database, `SELECT count(value) FROM cpu`, expected, "", 120*time.Second) if !ok { - t.Fatalf("test %s:rawDataReturnsInOrder failed, SELECT count() query returned unexpected data\nexp: %s\ngot: %s\n%d nodes responded correctly", testName, expected, got, nOK) + t.Fatalf("test %s:rawDataReturnsInOrder unable, SELECT count() query returned unexpected data\nexp: %s\ngot: %s\n%d nodes responded correctly", testName, expected, got, nOK) dumpClusterDiags(t, testName, nodes) dumpClusterStats(t, testName, nodes) } @@ -367,7 +367,7 @@ func runTest_rawDataReturnsInOrder(t *testing.T, testName string, nodes Cluster, expected = fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[%s]}]}]}`, strings.Join(expectedValues, ",")) got, ok, nOK = query(t, nodes, database, `SELECT value FROM cpu`, expected, "") if !ok { - t.Fatalf("test %s failed, SELECT query returned unexpected data\nexp: %s\ngot: %s\n%d nodes responded correctly", testName, expected, got, nOK) + t.Fatalf("test %s error, SELECT query returned unexpected data\nexp: %s\ngot: %s\n%d nodes responded correctly", testName, expected, got, nOK) dumpClusterDiags(t, testName, nodes) dumpClusterStats(t, testName, nodes) } @@ -399,7 +399,7 @@ func runTests_Errors(t *testing.T, nodes Cluster) { if tt.query != "" { got, ok, nOK := query(t, nodes, "", tt.query, tt.expected, "") if !ok { - t.Fatalf("Test '%s' failed, expected: %s, got: %s, %d nodes responded correctly", tt.name, tt.expected, got, nOK) + t.Fatalf("Test '%s' error, expected: %s, got: %s, %d nodes responded correctly", tt.name, tt.expected, got, nOK) } } } @@ -1568,9 +1568,9 @@ func runTestsData(t *testing.T, testName string, nodes Cluster, database, retent got, ok, nOK := queryAndWait(t, qNodes, rewriteDbRp(urlDb, database, retention), qry, rewriteDbRp(tt.expected, database, retention), rewriteDbRp(tt.expectPattern, database, retention), 30*time.Second) if !ok { if tt.expected != "" { - t.Fatalf("Test #%d: \"%s:%s\" failed\n query: %s\n exp: %s\n got: %s\n%d nodes responded correctly", i, testName, name, qry, rewriteDbRp(tt.expected, database, retention), got, nOK) + t.Fatalf("Test #%d: \"%s:%s\" error\n query: %s\n exp: %s\n got: %s\n%d nodes responded correctly", i, testName, name, qry, rewriteDbRp(tt.expected, database, retention), got, nOK) } else { - t.Fatalf("Test #%d: \"%s:%s\" failed\n query: %s\n exp: %s\n got: %s\n%d nodes responded correctly", i, testName, name, qry, rewriteDbRp(tt.expectPattern, database, retention), got, nOK) + t.Fatalf("Test #%d: \"%s:%s\" error\n query: %s\n exp: %s\n got: %s\n%d nodes responded correctly", i, testName, name, qry, rewriteDbRp(tt.expectPattern, database, retention), got, nOK) } dumpClusterDiags(t, name, nodes) dumpClusterStats(t, name, nodes) @@ -1868,7 +1868,7 @@ func Test_ServerSingleGraphiteIntegration_Default(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "graphite", `select * from "graphite"."raw".cpu`, expected, "", graphiteTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -1926,7 +1926,7 @@ func Test_ServerSingleGraphiteIntegration_FractionalTime(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "graphite", `select * from "graphite"."raw".cpu`, expected, "", graphiteTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -1983,7 +1983,7 @@ func Test_ServerSingleGraphiteIntegration_ZeroDataPoint(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "graphite", `select * from "graphite"."raw".cpu`, expected, "", graphiteTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -2025,14 +2025,14 @@ func Test_ServerSingleGraphiteIntegration_NoDatabase(t *testing.T) { expected := `{"results":[{"series":[{"name":"databases","columns":["name"],"values":[["graphite"]]}]}]}` got, ok, _ := queryAndWait(t, nodes, "graphite", `show databases`, expected, "", 2*time.Second) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } // Need to wait for the database to get a default retention policy expected = `{"results":[{"series":[{"columns":["name","duration","replicaN","default"],"values":[["default","0",1,true]]}]}]}` got, ok, _ = queryAndWait(t, nodes, "graphite", `show retention policies graphite`, expected, "", graphiteTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } t.Log("Writing data") @@ -2050,7 +2050,7 @@ func Test_ServerSingleGraphiteIntegration_NoDatabase(t *testing.T) { expected = fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",23.456]]}]}]}`, now.Format(time.RFC3339Nano)) got, ok, _ = queryAndWait(t, nodes, "graphite", `select * from "graphite"."default".cpu`, expected, "", 2*time.Second) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -2104,7 +2104,7 @@ func Test_ServerOpenTSDBIntegration(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu`, expected, "", openTSDBTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -2163,7 +2163,7 @@ func Test_ServerOpenTSDBIntegration_WithTags(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu where tag1='val3'`, expected, "", openTSDBTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -2220,7 +2220,7 @@ func Test_ServerOpenTSDBIntegration_BadData(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu`, expected, "", openTSDBTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -2266,7 +2266,7 @@ func Test_ServerOpenTSDBIntegrationHTTPSingle(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu`, expected, "", openTSDBTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -2314,7 +2314,7 @@ func Test_ServerOpenTSDBIntegrationHTTPMulti(t *testing.T) { // query and wait for results got, ok, _ := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu`, expected, "", openTSDBTestTimeout) if !ok { - t.Fatalf(`Test "%s" failed, expected: %s, got: %s`, testName, expected, got) + t.Fatalf(`Test "%s" error, expected: %s, got: %s`, testName, expected, got) } } @@ -2356,7 +2356,7 @@ func TestSeparateBrokerDataNode(t *testing.T) { defer broker.Close() if broker.Broker == nil { - t.Fatalf("Test %s: failed to create broker on port %d", testName, brokerConfig.Port) + t.Fatalf("Test %s: error to create broker on port %d", testName, brokerConfig.Port) } u := broker.Broker.URL() @@ -2366,7 +2366,7 @@ func TestSeparateBrokerDataNode(t *testing.T) { defer data.Close() if data.DataNode == nil { - t.Fatalf("Test %s: failed to create leader data node on port %d", testName, dataConfig.Port) + t.Fatalf("Test %s: error to create leader data node on port %d", testName, dataConfig.Port) } } @@ -2402,7 +2402,7 @@ func TestSeparateBrokerTwoDataNodes(t *testing.T) { defer broker.Close() if broker.Broker == nil { - t.Fatalf("Test %s: failed to create broker on port %d", testName, brokerConfig.Port) + t.Fatalf("Test %s: error to create broker on port %d", testName, brokerConfig.Port) } u := broker.Broker.URL() @@ -2422,7 +2422,7 @@ func TestSeparateBrokerTwoDataNodes(t *testing.T) { defer data1.Close() if data1.DataNode == nil { - t.Fatalf("Test %s: failed to create leader data node on port %d", testName, dataConfig1.Port) + t.Fatalf("Test %s: error to create leader data node on port %d", testName, dataConfig1.Port) } // Join data node 2 to single broker and first data node @@ -2439,7 +2439,7 @@ func TestSeparateBrokerTwoDataNodes(t *testing.T) { defer data2.Close() if data2.DataNode == nil { - t.Fatalf("Test %s: failed to create leader data node on port %d", testName, dataConfig2.Port) + t.Fatalf("Test %s: error to create leader data node on port %d", testName, dataConfig2.Port) } } diff --git a/influxql/engine_test.go b/influxql/engine_test.go index 50a8aa1d5c..fc9dd14fb6 100644 --- a/influxql/engine_test.go +++ b/influxql/engine_test.go @@ -16,7 +16,7 @@ func derivativeJob(t *testing.T, fn, interval string) *MapReduceJob { s := fmt.Sprintf("SELECT %s(mean(value)%s) FROM foo", fn, interval) q, err := ParseQuery(s) if err != nil { - t.Fatalf("failed to parse query %q: %s", s, err) + t.Fatalf("unable to parse query %q: %s", s, err) } m := &MapReduceJob{ stmt: q.Statements[0].(*SelectStatement), diff --git a/influxql/functions_test.go b/influxql/functions_test.go index 094c62fdba..fb517bee64 100644 --- a/influxql/functions_test.go +++ b/influxql/functions_test.go @@ -500,11 +500,11 @@ func TestGetSortedRange(t *testing.T) { for _, tt := range getSortedRangeTests { results := getSortedRange(tt.data, tt.start, tt.count) if len(results) != len(tt.expected) { - t.Errorf("Test %s failed. Expected getSortedRange to return %v but got %v", tt.name, tt.expected, results) + t.Errorf("Test %s error. Expected getSortedRange to return %v but got %v", tt.name, tt.expected, results) } for i, point := range tt.expected { if point != results[i] { - t.Errorf("Test %s failed. getSortedRange returned wrong result for index %v. Expected %v but got %v", tt.name, i, point, results[i]) + t.Errorf("Test %s error. getSortedRange returned wrong result for index %v. Expected %v but got %v", tt.name, i, point, results[i]) } } } diff --git a/meta/retention_policy_enforcer.go b/meta/retention_policy_enforcer.go index a0a1830f17..efe8c89e2b 100644 --- a/meta/retention_policy_enforcer.go +++ b/meta/retention_policy_enforcer.go @@ -58,7 +58,7 @@ func (s *Server) EnforceRetentionPolicies() { for _, g := range groups { if err := s.DeleteShardGroup(g.Database, g.Retention, g.ID); err != nil { - log.Printf("failed to request deletion of shard group %d: %s", g.ID, err.Error()) + log.Printf("unable to request deletion of shard group %d: %s", g.ID, err.Error()) } } } diff --git a/meta/shard_group_precreator.go b/meta/shard_group_precreator.go index 7e2c3c0255..8147078857 100644 --- a/meta/shard_group_precreator.go +++ b/meta/shard_group_precreator.go @@ -67,7 +67,7 @@ func (s *Server) ShardGroupPreCreate(checkInterval time.Duration) { for _, g := range groups { if err := s.CreateShardGroupIfNotExists(g.Database, g.Retention, g.Time); err != nil { - log.Printf("failed to request pre-creation of shard group %d for time %s: %s", g.ID, g.Time, err.Error()) + log.Printf("unable to request pre-creation of shard group %d for time %s: %s", g.ID, g.Time, err.Error()) } } } diff --git a/services/admin/service.go b/services/admin/service.go index 7eb6c766bf..ba2e79e07c 100644 --- a/services/admin/service.go +++ b/services/admin/service.go @@ -70,7 +70,7 @@ func (s *Service) serve() { // Run file system handler on listener. err = http.Serve(s.listener, http.FileServer(statikFS)) if err != nil && !strings.Contains(err.Error(), "closed") { - s.err <- fmt.Errorf("listener failed: addr=%s, err=%s", s.Addr(), err) + s.err <- fmt.Errorf("listener error: addr=%s, err=%s", s.Addr(), err) } } diff --git a/services/graphite/graphite_tcp.go b/services/graphite/graphite_tcp.go index 7e4e284b70..cf6b00c325 100644 --- a/services/graphite/graphite_tcp.go +++ b/services/graphite/graphite_tcp.go @@ -116,7 +116,7 @@ func (t *TCPServer) handleConnection(conn net.Conn) { // Send the data to the writer. _, e := t.writer.WriteSeries(t.database, "", []tsdb.Point{point}) if e != nil { - t.Logger.Printf("failed to write data point to database %q: %s\n", t.database, e) + t.Logger.Printf("unable to write data point to database %q: %s\n", t.database, e) } } } diff --git a/services/graphite/graphite_test.go b/services/graphite/graphite_test.go index 71fb7faeb3..c67195a4a6 100644 --- a/services/graphite/graphite_test.go +++ b/services/graphite/graphite_test.go @@ -167,22 +167,22 @@ func Test_DecodeMetric(t *testing.T) { err: `received "50.554 1419972457825" which doesn't have three fields`, }, { - test: "should fail on invalid key", + test: "should error on invalid key", line: `foo.cpu 50.554 1419972457825`, err: `received "foo.cpu" which doesn't conform to format of key.value.key.value.name or name`, }, { - test: "should fail parsing invalid float", + test: "should error parsing invalid float", line: `cpu 50.554z 1419972457825`, err: `field "cpu" value: strconv.ParseFloat: parsing "50.554z": invalid syntax`, }, { - test: "should fail parsing invalid int", + test: "should error parsing invalid int", line: `cpu 50z 1419972457825`, err: `field "cpu" value: strconv.ParseFloat: parsing "50z": invalid syntax`, }, { - test: "should fail parsing invalid time", + test: "should error parsing invalid time", line: `cpu 50.554 14199724z57825`, err: `field "cpu" time: strconv.ParseFloat: parsing "14199724z57825": invalid syntax`, }, diff --git a/services/graphite/graphite_udp.go b/services/graphite/graphite_udp.go index 9a615babd8..b59fe0c3ac 100644 --- a/services/graphite/graphite_udp.go +++ b/services/graphite/graphite_udp.go @@ -78,7 +78,7 @@ func (u *UDPServer) ListenAndServe(iface string) error { // Send the data to the writer. _, e := u.writer.WriteSeries(u.database, "", []tsdb.Point{point}) if e != nil { - u.Logger.Printf("failed to write data point: %s\n", e) + u.Logger.Printf("unable to write data point: %s\n", e) } } } diff --git a/services/httpd/handler.go b/services/httpd/handler.go index 64e3703aa4..e58e62e68c 100644 --- a/services/httpd/handler.go +++ b/services/httpd/handler.go @@ -283,7 +283,7 @@ func (h *Handler) serveWrite(w http.ResponseWriter, r *http.Request, user *meta. if h.WriteTrace { b, err := ioutil.ReadAll(body) if err != nil { - h.Logger.Print("write handler failed to read bytes from request body") + h.Logger.Print("write handler unable to read bytes from request body") } else { h.Logger.Printf("write body received by handler: %s", string(b)) } @@ -369,7 +369,7 @@ func (h *Handler) serveWritePoints(w http.ResponseWriter, r *http.Request, user b, err := ioutil.ReadAll(body) if err != nil { if h.WriteTrace { - h.Logger.Print("write handler failed to read bytes from request body") + h.Logger.Print("write handler unable to read bytes from request body") } writeError(influxql.Result{Err: err}, http.StatusBadRequest) return diff --git a/stats_test.go b/stats_test.go index 680f8d66fd..f4e2c8038e 100644 --- a/stats_test.go +++ b/stats_test.go @@ -11,7 +11,7 @@ func TestStats_Set(t *testing.T) { s := influxdb.NewStats("foo") s.Set("a", 100) if s.Get("a") != 100 { - t.Fatalf("stats set failed, expected 100, got %d", s.Get("a")) + t.Fatalf("stats set error, expected 100, got %d", s.Get("a")) } } @@ -21,7 +21,7 @@ func TestStats_Add(t *testing.T) { s.Add("a", 200) if s.Get("a") != 200 { - t.Fatalf("stats set failed, expected 200, got %d", s.Get("a")) + t.Fatalf("stats set error, expected 200, got %d", s.Get("a")) } } @@ -31,7 +31,7 @@ func TestStats_Add_Negative(t *testing.T) { s.Add("a", -200) if s.Get("a") != -200 { - t.Fatalf("stats set failed, expected -200, got %d", s.Get("a")) + t.Fatalf("stats set error, expected -200, got %d", s.Get("a")) } } @@ -42,12 +42,12 @@ func TestStats_Inc(t *testing.T) { s.Set("a", 100) s.Inc("a") if s.Get("a") != 101 { - t.Fatalf("stats Inc failed, expected 101, got %d", s.Get("a")) + t.Fatalf("stats Inc error, expected 101, got %d", s.Get("a")) } s.Inc("b") if s.Get("b") != 1 { - t.Fatalf("stats Inc failed, expected 1, got %d", s.Get("b")) + t.Fatalf("stats Inc error, expected 1, got %d", s.Get("b")) } } @@ -57,7 +57,7 @@ func TestStats_SetAndAdd(t *testing.T) { s.Set("a", 100) s.Add("a", 200) if s.Get("a") != 300 { - t.Fatalf("stats set failed, expected 300, got %d", s.Get("a")) + t.Fatalf("stats set error, expected 300, got %d", s.Get("a")) } } @@ -98,6 +98,6 @@ func TestStats_String(t *testing.T) { if exp, got := `{"server":[{"a":100},{"b":600}]}`, s.String(); exp != got { t.Log("exp: ", exp) t.Log("got: ", got) - t.Fatalf("failed to get string") + t.Fatalf("error to get string") } }