From f9820349d0599f2fe7d9bf60dcbd19fc8df1cc05 Mon Sep 17 00:00:00 2001 From: Cameron Davison Date: Fri, 12 Aug 2016 21:48:49 -0500 Subject: [PATCH] allow multiple evals check last one in test --- api/evaluations_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/evaluations_test.go b/api/evaluations_test.go index 2a66534e8..888ecced4 100644 --- a/api/evaluations_test.go +++ b/api/evaluations_test.go @@ -40,9 +40,11 @@ func TestEvaluations_List(t *testing.T) { } assertQueryMeta(t, qm) - // Check if we have the right list - if len(result) != 1 || result[0].ID != evalID { - t.Fatalf("bad: %#v", result) + // if the eval fails fast there can be more than 1 + // but they are in order of most recent first, so look at the last one + idx := len(result) - 1 + if len(result) == 0 || result[idx].ID != evalID { + t.Fatalf("expected eval (%s), got: %#v", evalID, result[idx]) } }