Skip to content

Commit 0e9ab83

Browse files
committed
test: fix timeouts so TestTxMempool_ExpiredTxs_Timestamp pass on GitHub
modified: mempool/v1/mempool_test.go
1 parent 50e9e57 commit 0e9ab83

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

mempool/v1/mempool_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ func TestTxMempool_ConcurrentTxs(t *testing.T) {
522522

523523
func TestTxMempool_ExpiredTxs_Timestamp(t *testing.T) {
524524
txmp := setup(t, 5000)
525-
txmp.config.TTLDuration = 5 * time.Millisecond
525+
txmp.config.TTLDuration = 500 * time.Millisecond
526526

527527
added1 := checkTxs(t, txmp, 10, 0)
528528
require.Equal(t, len(added1), txmp.Size())
@@ -531,19 +531,19 @@ func TestTxMempool_ExpiredTxs_Timestamp(t *testing.T) {
531531
// when the first batch TTLs out.
532532
//
533533
// ms: 0 1 2 3 4 5 6
534-
// ^ ^ ^ ^
535-
// | | | +-- Update (triggers pruning)
536-
// | | +------ first batch expires
537-
// | +-------------- second batch added
534+
// ^ ^ ^ ^
535+
// | | | +-- Update (triggers pruning)
536+
// | | +------ first batch expires
537+
// | +---------- second batch added
538538
// +-------------------------- first batch added
539539
//
540540
// The exact intervals are not important except that the delta should be
541541
// large relative to the cost of CheckTx (ms vs. ns is fine here).
542-
time.Sleep(3 * time.Millisecond)
542+
time.Sleep(400 * time.Millisecond)
543543
added2 := checkTxs(t, txmp, 10, 1)
544544

545545
// Wait a while longer, so that the first batch will expire.
546-
time.Sleep(3 * time.Millisecond)
546+
time.Sleep(200 * time.Millisecond)
547547

548548
// Trigger an update so that pruning will occur.
549549
txmp.Lock()

0 commit comments

Comments
 (0)