From d5aefc409e3dda869ea593b81d9874e0ab989efd Mon Sep 17 00:00:00 2001 From: Andrew Richardson Date: Tue, 9 Aug 2022 16:04:29 -0400 Subject: [PATCH] Remove unneeded sleep from txcommon test Fixes #618 Signed-off-by: Andrew Richardson --- internal/txcommon/txcommon_test.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/internal/txcommon/txcommon_test.go b/internal/txcommon/txcommon_test.go index 1b10851f2..2d04b17f5 100644 --- a/internal/txcommon/txcommon_test.go +++ b/internal/txcommon/txcommon_test.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "testing" - "time" "github.com/hyperledger/firefly-common/pkg/config" "github.com/hyperledger/firefly-common/pkg/fftypes" @@ -376,7 +375,7 @@ func TestGetTransactionByIDCached(t *testing.T) { mdi := &databasemocks.Plugin{} mdm := &datamocks.Manager{} - txHelper, txCache, _ := NewTestTransactionHelper(mdi, mdm) + txHelper, _, _ := NewTestTransactionHelper(mdi, mdm) ctx := context.Background() txid := fftypes.NewUUID() @@ -388,16 +387,10 @@ func TestGetTransactionByIDCached(t *testing.T) { BlockchainIDs: core.FFStringArray{"0x111111"}, }, nil).Once() - previousTxCacheSize := txCache.ItemCount() - tx, err := txHelper.GetTransactionByIDCached(ctx, txid) assert.NoError(t, err) assert.Equal(t, txid, tx.ID) - for txCache.ItemCount() <= previousTxCacheSize { - time.Sleep(time.Millisecond * 1) - } - tx, err = txHelper.GetTransactionByIDCached(ctx, txid) assert.NoError(t, err) assert.Equal(t, txid, tx.ID)