Prechádzať zdrojové kódy

Fix race conditions in minting tests

There was a race conditions between the database storing the mint quote and the
fake wallet paying the invoice of a yet not existing mint quote

Add a delay of seconds before paying all invoices

To recreate the slow conditions that would make our database slower than the
external Fakewallet in Linux

```
sudo tc qdisc add dev lo root netem delay 200ms 50ms
ionice -c3  nix develop -i -L .#stable --command just itest-payment-processor FAKEWALLET
```

To reset

```
sudo tc qdisc del dev lo root

```
Cesar Rodas 1 mesiac pred
rodič
commit
9ab8ed875c

+ 1 - 1
crates/cdk-integration-tests/src/init_auth_mint.rs

@@ -33,7 +33,7 @@ where
         fee_reserve,
         HashMap::default(),
         HashSet::default(),
-        0,
+        2,
         CurrencyUnit::Sat,
     );
 

+ 1 - 1
crates/cdk-integration-tests/src/init_pure_tests.rs

@@ -247,7 +247,7 @@ pub async fn create_and_start_test_mint() -> Result<Mint> {
         fee_reserve.clone(),
         HashMap::default(),
         HashSet::default(),
-        0,
+        2,
         CurrencyUnit::Sat,
     );
 

+ 1 - 1
crates/cdk-payment-processor/src/bin/payment_processor.rs

@@ -122,7 +122,7 @@ async fn main() -> anyhow::Result<()> {
                         fee_reserve,
                         HashMap::default(),
                         HashSet::default(),
-                        0,
+                        2,
                         cashu::CurrencyUnit::Sat,
                     );