From 83c8916c4604394a897780d92ff8c05ac9a13249 Mon Sep 17 00:00:00 2001 From: Thomas Nguy <81727899+thomas-nguy@users.noreply.github.com> Date: Wed, 13 Oct 2021 18:07:20 +0900 Subject: [PATCH] fix pubsub underterministic test (#666) --- rpc/ethereum/pubsub/pubsub_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpc/ethereum/pubsub/pubsub_test.go b/rpc/ethereum/pubsub/pubsub_test.go index 3616c6ea..fbaa0ef2 100644 --- a/rpc/ethereum/pubsub/pubsub_test.go +++ b/rpc/ethereum/pubsub/pubsub_test.go @@ -2,6 +2,7 @@ package pubsub import ( "log" + "sort" "sync" "testing" "time" @@ -21,7 +22,9 @@ func TestAddTopic(t *testing.T) { err = q.AddTopic("lol", make(<-chan coretypes.ResultEvent)) require.Error(t, err) - require.EqualValues(t, []string{"kek", "lol"}, q.Topics()) + topics := q.Topics() + sort.Strings(topics) + require.EqualValues(t, []string{"kek", "lol"}, topics) } func TestSubscribe(t *testing.T) {