cashubtc / cdk

Cashu Development Kit
MIT License
87 stars 44 forks source link

Flakey CI tests when minting #432

Closed thesimplekid closed 2 weeks ago

thesimplekid commented 3 weeks ago

Some of the ci tests fail when the wallet attempts to mint before the invoice is marked as paid. We should wait till mint invoice is paid by polling check endpoint

delcin-raj commented 3 weeks ago

I would like to work on this.

thesimplekid commented 3 weeks ago

I would like to work on this.

Go for it, thanks.

We should just be able to add a loop in that checks for the quote to be marked as paid by polling the check endpoint. I think one of the tests does this not there is an example here, though in the tests with fake wallet we should be able to sleep for less time.

delcin-raj commented 3 weeks ago

I would like to work on this.

Go for it, thanks.

We should just be able to add a loop in that checks for the quote to be marked as paid by polling the check endpoint. I think one of the tests does this not there is an example here, though in the tests with fake wallet we should be able to sleep for less time.

The errors are occuring in melt_bolt11 primarily due to "Unknown Invoice" error. I'm running the CI using ./misc/fake_itests.sh MEMORY.

Some more information would be helpful.

thesimplekid commented 3 weeks ago

Those are logged errors but in the test they are expected since it is checking error cases they aren't causing tests to fail. The flaky tests on the mint, there are currently just sleeps in place between getting the mint quote and attempting to fill it where the fake wallet should mark it as paid. But occasionally this sleep isnt long enough so it should be replaces will the loop checking the state as i linked above.

https://github.com/cashubtc/cdk/blob/3db25640dc2177f009dd27dc117d61fd0d2d0c11/crates/cdk-integration-tests/tests/fake_wallet.rs#L33

delcin-raj commented 2 weeks ago

https://github.com/cashubtc/cdk/pull/440