fix pubsub underterministic test (#666)

This commit is contained in:
Thomas Nguy 2021-10-13 18:07:20 +09:00 committed by GitHub
parent 2e067590a2
commit 83c8916c46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {