Backport of Fix broken tests. into release/1.17.x (#20133)

* backport of commit 7a91738824

* Fix broken test.

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
pull/20142/head
hc-github-team-consul-core 2024-01-09 14:35:02 -06:00 committed by GitHub
parent 69a3ea5890
commit 14928687bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -141,6 +141,7 @@ func TestConfig_Get(t *testing.T) {
// Set indexes and EnterpriseMeta to expected values for assertions
ce.CreateIndex = 12
ce.ModifyIndex = 13
ce.Hash = 0
ce.EnterpriseMeta = acl.EnterpriseMeta{}
ce.Hash = 0
@ -451,6 +452,7 @@ func TestConfig_Apply_IngressGateway(t *testing.T) {
// Ignore create and modify indices
got.CreateIndex = 0
got.ModifyIndex = 0
got.Hash = 0
expect := &structs.IngressGatewayConfigEntry{
Name: "ingress",

View File

@ -552,7 +552,6 @@ func TestIntentionApply_WithoutIDs(t *testing.T) {
RaftIndex: entry.RaftIndex,
Hash: entry.GetHash(),
}
require.Equal(t, expect, entry)
}
@ -692,7 +691,6 @@ func TestIntentionApply_WithoutIDs(t *testing.T) {
RaftIndex: entry.RaftIndex,
Hash: entry.GetHash(),
}
require.Equal(t, expect, entry)
}

View File

@ -2003,6 +2003,7 @@ func TestDatacenterSupportsIntentionsAsConfigEntries(t *testing.T) {
if err := srv.RPC(context.Background(), "ConfigEntry.Get", &arg, &reply); err != nil {
return nil, err
}
reply.Entry.SetHash(0)
return reply.Entry, nil
}
@ -2088,7 +2089,7 @@ func TestDatacenterSupportsIntentionsAsConfigEntries(t *testing.T) {
RaftIndex: got.RaftIndex,
Hash: got.GetHash(),
}
got.Hash = 0
require.Equal(t, expect, got)
})