diff --git a/swarm/storage/localstore/subscription_pull_test.go b/swarm/storage/localstore/subscription_pull_test.go index 744cd5d71e..4804423a8f 100644 --- a/swarm/storage/localstore/subscription_pull_test.go +++ b/swarm/storage/localstore/subscription_pull_test.go @@ -65,9 +65,11 @@ func TestDB_SubscribePull(t *testing.T) { // upload some chunks just after subscribe uploadRandomChunksBin(t, db, uploader, addrs, &wantedChunksCount, 5) - time.Sleep(500 * time.Millisecond) + time.Sleep(200 * time.Millisecond) // upload some chunks after some short time + // to ensure that subscription will include them + // in a dynamic environment uploadRandomChunksBin(t, db, uploader, addrs, &wantedChunksCount, 3) checkErrChan(ctx, t, errChan, wantedChunksCount) @@ -117,9 +119,11 @@ func TestDB_SubscribePull_multiple(t *testing.T) { // upload some chunks just after subscribe uploadRandomChunksBin(t, db, uploader, addrs, &wantedChunksCount, 5) - time.Sleep(500 * time.Millisecond) + time.Sleep(200 * time.Millisecond) // upload some chunks after some short time + // to ensure that subscription will include them + // in a dynamic environment uploadRandomChunksBin(t, db, uploader, addrs, &wantedChunksCount, 3) checkErrChan(ctx, t, errChan, wantedChunksCount*subsCount) diff --git a/swarm/storage/localstore/subscription_push_test.go b/swarm/storage/localstore/subscription_push_test.go index 1bcd28ddc3..1c4b1465d2 100644 --- a/swarm/storage/localstore/subscription_push_test.go +++ b/swarm/storage/localstore/subscription_push_test.go @@ -96,9 +96,11 @@ func TestDB_SubscribePush(t *testing.T) { // upload some chunks just after subscribe uploadRandomChunks(5) - time.Sleep(500 * time.Millisecond) + time.Sleep(200 * time.Millisecond) // upload some chunks after some short time + // to ensure that subscription will include them + // in a dynamic environment uploadRandomChunks(3) checkErrChan(ctx, t, errChan, len(chunks)) @@ -177,9 +179,11 @@ func TestDB_SubscribePush_multiple(t *testing.T) { // upload some chunks just after subscribe uploadRandomChunks(5) - time.Sleep(500 * time.Millisecond) + time.Sleep(200 * time.Millisecond) // upload some chunks after some short time + // to ensure that subscription will include them + // in a dynamic environment uploadRandomChunks(3) // number of addresses received by all subscriptions