From fd6beefe11d236e89116045e03f689817c80d826 Mon Sep 17 00:00:00 2001 From: Chris Baker <1675087+cgbaker@users.noreply.github.com> Date: Tue, 5 Jan 2021 13:42:18 +0000 Subject: [PATCH] simple test to ensure that scaling endpoint methods support IsRead for stale read support --- nomad/scaling_endpoint_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nomad/scaling_endpoint_test.go b/nomad/scaling_endpoint_test.go index a4f83b1f3..73311b1f6 100644 --- a/nomad/scaling_endpoint_test.go +++ b/nomad/scaling_endpoint_test.go @@ -5,6 +5,7 @@ import ( "time" msgpackrpc "github.com/hashicorp/net-rpc-msgpackrpc" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/hashicorp/nomad/acl" @@ -14,6 +15,14 @@ import ( "github.com/hashicorp/nomad/testutil" ) +func TestScalingEndpoint_StaleReadSupport(t *testing.T) { + assert := assert.New(t) + list := &structs.ScalingPolicyListRequest{} + assert.True(list.IsRead()) + get := &structs.ScalingPolicySpecificRequest{} + assert.True(get.IsRead()) +} + func TestScalingEndpoint_GetPolicy(t *testing.T) { t.Parallel() require := require.New(t)