From a7ea26192b4528101ed48b9ff0d425fb0adf5134 Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Thu, 20 Oct 2022 11:45:15 -0400 Subject: [PATCH] Update expected encoding in test go-memdb was updated in v1.3.3 to make integers in indexes sortable, which changed how integers were encoded. --- agent/consul/state/catalog_oss_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agent/consul/state/catalog_oss_test.go b/agent/consul/state/catalog_oss_test.go index 0fa9129730..e0b8dd74fc 100644 --- a/agent/consul/state/catalog_oss_test.go +++ b/agent/consul/state/catalog_oss_test.go @@ -5,6 +5,7 @@ package state import ( "net" + "strconv" "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/structs" @@ -226,7 +227,11 @@ func testIndexerTableGatewayServices() map[string]indexerTestCase { Service: structs.ServiceName{Name: "SerVice"}, Port: 50123, } - encodedPort := string([]byte{0x96, 0x8f, 0x06, 0, 0, 0, 0, 0, 0, 0}) + encodedPort := string([]byte{0x80, 0, 0, 0, 0, 0, 0xc3, 0xcb}) + // On 32-bit systems the int encoding will be different + if strconv.IntSize == 32 { + encodedPort = string([]byte{0x80, 0, 0xc3, 0xcb}) + } return map[string]indexerTestCase{ indexID: { read: indexValue{