swarm/storage/localstore: adjust subscriptions tests delays and comments

This commit is contained in:
Janos Guljas 2019-01-08 15:50:49 +01:00
parent c5e4c61385
commit 015d9775d4
2 changed files with 12 additions and 4 deletions

View file

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

View file

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