1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-24 14:50:46 +01:00
eclair/eclair-core
Bastien Teinturier a9146dda09
Fix flaky tests (#2520)
* mempooltxmonitor: no need to unsubscribe from event stream

Adapters are child actors that will die along with their parents, and
the eventstream watches all subscribers for termination:
a8ee6fa42b/akka-actor/src/main/scala/akka/event/EventStream.scala (L50).

* mempooltxmonitor: send block count to actor

This solves a race condition with event stream subscription.

* Fix failing NormalStateSpec test

The `recv CurrentBlockCount (fulfilled signed htlc ignored by upstream peer)`
test was sometimes failing because of an event stream concurrency
issue on busy/slow machines:

- the previous test emits a `LocalChannelDown` event
- the next test starts before this event was emitted and registers to the
  event stream
- then it receives the previous `LocalChannelDown` event before the
  `LocalChannelUpdate`s we expect

* Improve MinimalNodeFixture watcher autopilot

We create an alternative ZmqWatcher that waits for the channel funder
to publish funding transactions before triggering watches.

* Fix ZeroConfAliasIntegrationSpec

A test was added to verify that when building a route to self, we use the
correct scid-alias when available (remote alias instead of local).

This test sometimes failed because Carol hadn't received Alice's channel
update and couldn't build the Alice->Bob hop. The only thing that we meant
to test was the Bob->Carol hop, so we can simplify that and remove the
flakiness,

* Fix MempoolTxMonitorSpec

We use context.pipeToSelf when publishing the transaction, which creates
a race condition between the time when the tx is added to the mempool and
the time where we're ready to process `WrappedCurrentBlockHeight`.

If `WrappedCurrentBlockHeight` arrives before `PublishOk`, the test will
fail waiting for `TxInMempool`.

* Fix TxTimeLocksMonitorSpec

The usual race condition for registering to the event stream applies,
so we directly send the `WrappedCurrentBlockHeight` event.

* Fix ZmqWatcherSpec

Some tests are randomly failing because watches can be triggered several
times and new blocks from previous tests may trigger events in subsequent
tests. We fish for the specific messages we're interested in and ignore
others.
2022-12-16 14:54:36 +01:00
..
src Fix flaky tests (#2520) 2022-12-16 14:54:36 +01:00
eclair-cli Make eclair-cli -s display short channel ids correctly (#2488) 2022-11-15 15:56:40 +01:00
pom.xml Switch embedded postgres library used in tests (#2518) 2022-12-08 13:19:29 +01:00