From fa044de37a0b82d1d8031e0f2fd1201564267c5b Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Wed, 14 Feb 2018 10:30:26 -0800 Subject: [PATCH] fix test --- api/nodes_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/nodes_test.go b/api/nodes_test.go index 2868b5d77..2a2727788 100644 --- a/api/nodes_test.go +++ b/api/nodes_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/hashicorp/nomad/helper/uuid" + "github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/nomad/testutil" "github.com/stretchr/testify/require" ) @@ -287,7 +288,7 @@ func TestNodes_GC(t *testing.T) { err := nodes.GC(uuid.Generate(), nil) require.NotNil(err) - require.Contains(err.Error(), "Unknown node") + require.True(structs.IsErrUnknownNode(err)) } func TestNodes_GcAlloc(t *testing.T) { @@ -299,5 +300,5 @@ func TestNodes_GcAlloc(t *testing.T) { err := nodes.GcAlloc(uuid.Generate(), nil) require.NotNil(err) - require.Contains(err.Error(), "unknown allocation") + require.True(structs.IsErrUnknownAllocation(err)) }