fix: constrainted env add wait to TestRelaySubscription

This commit is contained in:
harsh-98 2023-05-05 22:44:08 +05:30 committed by RichΛrd
parent bf8c856bc3
commit 38741caca0
3 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,6 @@ func TestWakuRelay(t *testing.T) {
host, err := tests.MakeHost(context.Background(), port, rand.Reader) host, err := tests.MakeHost(context.Background(), port, rand.Reader)
require.NoError(t, err) require.NoError(t, err)
relay := NewWakuRelay(nil, 0, timesource.NewDefaultClock(), utils.Logger()) relay := NewWakuRelay(nil, 0, timesource.NewDefaultClock(), utils.Logger())
relay.SetHost(host) relay.SetHost(host)
err = relay.Start(context.Background()) err = relay.Start(context.Background())

View File

@ -59,6 +59,9 @@ func TestRelaySubscription(t *testing.T) {
go d.Start(context.Background()) go d.Start(context.Background())
defer d.Stop() defer d.Stop()
// Wait for node to start
time.Sleep(500 * time.Millisecond)
topics := []string{"test"} topics := []string{"test"}
topicsJSONBytes, err := json.Marshal(topics) topicsJSONBytes, err := json.Marshal(topics)
require.NoError(t, err) require.NoError(t, err)

View File

@ -39,7 +39,6 @@ func makeFilterService(t *testing.T, isFullNode bool) *FilterService {
go func() { go func() {
for range sub.Ch { for range sub.Ch {
} }
fmt.Println("stuck")
}() }()
require.NoError(t, err) require.NoError(t, err)
} }