Skip to content

Commit

Permalink
Dump cluster diags if table-tests fail
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Apr 17, 2015
1 parent b3f507b commit b621ae7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/influxd/server_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit b621ae7

Please sign in to comment.