Skip to content

Commit

Permalink
fix(mempool/cat): TestReactorEventuallyRemovesExpiredTransaction flak…
Browse files Browse the repository at this point in the history
…y test (#1566)

## Description

_Please add a description of the changes that this PR introduces and the
files that
are the most critical to review._ 

Closes #1131 

Relax the time constrain for testing the eventual expiring of
transactions.


#### PR checklist

- [x] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
  • Loading branch information
tuantran1702 authored Dec 20, 2024
1 parent 2a9044f commit bbaf82b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mempool/cat/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ func TestReactorEventuallyRemovesExpiredTransaction(t *testing.T) {
require.True(t, reactor.mempool.Has(key))

// wait for the transaction to expire
time.Sleep(reactor.mempool.config.TTLDuration * 2)
require.False(t, reactor.mempool.Has(key))
require.Eventually(t,
func() bool { return !reactor.mempool.Has(key) },
4*reactor.mempool.config.TTLDuration,
50*time.Millisecond,
"transaction was not removed after TTL expired")
}

func TestLegacyReactorReceiveBasic(t *testing.T) {
Expand Down

0 comments on commit bbaf82b

Please sign in to comment.