@@ 78,14 78,12 @@ event=error code=456 msg="something went wrong" timestamp="1970-01-01 18:56" fla
}
func Test_CSV(t *testing.T) {
- // TODO: this test is flaky because the keys can be in potentially any
- // order.
-
input := "c1=5 c2=true c3=3.4\nc1=3 c2=false c3=5.1"
inputReader := strings.NewReader(input)
buf := bytes.NewBufferString("")
- err := RunQuery(inputReader, buf, "SELECT * FROM log;", CSV)
+ // We use an explicit list of columns so as to guarantee their order.
+ err := RunQuery(inputReader, buf, "SELECT c1,c2,c3 FROM log;", CSV)
assert.Nil(t, err)
assert.Equal(t, "c1,c2,c3\n5,true,3.4\n3,false,5.1\n", buf.String())