From b621ae73920c3e2fddb011960f6ddbc09914af91 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Fri, 17 Apr 2015 15:55:45 -0700 Subject: [PATCH] Dump cluster diags if table-tests fail --- cmd/influxd/server_integration_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/influxd/server_integration_test.go b/cmd/influxd/server_integration_test.go index 794a3e7bab5..e150266e27d 100644 --- a/cmd/influxd/server_integration_test.go +++ b/cmd/influxd/server_integration_test.go @@ -176,6 +176,15 @@ func deleteDatabase(t *testing.T, testName string, nodes Cluster, database strin query(t, nodes[:1], "", "DROP DATABASE "+database, `{"results":[{}]}`, "") } +// dumpClusterDiags dumps the diagnositcs of each node. +func dumpClusterDiags(t *testing.T, testName string, nodes Cluster) { + t.Logf("Test: %s: dumping node diagnostics", testName) + for _, n := range nodes { + r, _, _ := query(t, Cluster{n}, "", "SHOW DIAGNOSTICS", "", "") + t.Log(r) + } +} + // writes writes the provided data to the cluster. It verfies that a 200 OK is returned by the server. func write(t *testing.T, node *TestNode, data string) { u := urlFor(node.url, "write", url.Values{}) @@ -1377,6 +1386,7 @@ func runTestsData(t *testing.T, testName string, nodes Cluster, database, retent } else { t.Errorf("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) } + dumpClusterDiags(t, name, nodes) } } }