From 2b27fd0ec4fc831a809f8fd9b9fa730586b08b41 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Thu, 3 Oct 2024 11:32:40 +0200 Subject: [PATCH] sort test for stable order Signed-off-by: Kristoffer Dalby --- hscontrol/db/preauth_keys_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hscontrol/db/preauth_keys_test.go b/hscontrol/db/preauth_keys_test.go index 9dd5b199..ec3f6441 100644 --- a/hscontrol/db/preauth_keys_test.go +++ b/hscontrol/db/preauth_keys_test.go @@ -1,6 +1,7 @@ package db import ( + "sort" "time" "github.com/juanfont/headscale/hscontrol/types" @@ -169,5 +170,7 @@ func (*Suite) TestPreAuthKeyACLTags(c *check.C) { listedPaks, err := db.ListPreAuthKeys("test8") c.Assert(err, check.IsNil) - c.Assert(listedPaks[0].Proto().GetAclTags(), check.DeepEquals, tags) + gotTags := listedPaks[0].Proto().GetAclTags() + sort.Sort(sort.StringSlice(gotTags)) + c.Assert(gotTags, check.DeepEquals, tags) }