mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-24 20:14:21 +01:00
Mint: table locks (#566)
* clean up db * db: table lock * db.table_with_schema * fix encrypt.py * postgres nowait * add timeout to lock * melt quote state in db * kinda working * kinda working with postgres * remove dispose * getting there * porperly clean up db for tests * faster tests * configure connection pooling * try github with connection pool * invoice dispatcher does not lock db * fakewallet: pay_if_regtest waits * pay fakewallet invoices * add more * faster * slower * pay_if_regtest async * do not lock the invoice dispatcher * test: do I get disk I/O errors if we disable the invoice_callback_dispatcher? * fix fake so it workss without a callback dispatchert * test on github * readd tasks * refactor * increase time for lock invoice disatcher * try avoiding a race * remove task * github actions: test regtest with postgres * mint per module * no connection pool for testing * enable pool * do not resend paid event * reuse connection * close db connections * sessions * enable debug * dispose engine * disable connection pool for tests * enable connection pool for postgres only * clean up shutdown routine * remove wait for lightning fakewallet lightning invoice * cancel invoice listener tasks on shutdown * fakewallet conftest: decrease outgoing delay * delay payment and set postgres only if needed * disable fail fast for regtest * clean up regtest.yml * change order of tests_db.py * row-specific mint_quote locking * refactor * fix lock statement * refactor swap * refactor * remove psycopg2 * add connection string example to .env.example * remove unnecessary pay * shorter sleep in test_wallet_subscription_swap
This commit is contained in:
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -28,13 +28,14 @@ jobs:
|
||||
regtest:
|
||||
uses: ./.github/workflows/regtest.yml
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.10"]
|
||||
poetry-version: ["1.7.1"]
|
||||
backend-wallet-class:
|
||||
["LndRestWallet", "CLNRestWallet", "CoreLightningRestWallet", "LNbitsWallet"]
|
||||
# mint-database: ["./test_data/test_mint", "postgres://cashu:cashu@localhost:5432/cashu"]
|
||||
mint-database: ["./test_data/test_mint"]
|
||||
mint-database: ["./test_data/test_mint", "postgres://cashu:cashu@localhost:5432/cashu"]
|
||||
# mint-database: ["./test_data/test_mint"]
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
backend-wallet-class: ${{ matrix.backend-wallet-class }}
|
||||
|
||||
22
.github/workflows/regtest.yml
vendored
22
.github/workflows/regtest.yml
vendored
@@ -23,21 +23,13 @@ jobs:
|
||||
regtest:
|
||||
runs-on: ${{ inputs.os-version }}
|
||||
timeout-minutes: 10
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: cashu
|
||||
POSTGRES_PASSWORD: cashu
|
||||
POSTGRES_DB: cashu
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- name: Start PostgreSQL service
|
||||
if: contains(inputs.mint-database, 'postgres')
|
||||
run: |
|
||||
docker run -d --name postgres -e POSTGRES_USER=cashu -e POSTGRES_PASSWORD=cashu -e POSTGRES_DB=cashu -p 5432:5432 postgres:latest
|
||||
until docker exec postgres pg_isready; do sleep 1; done
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ./.github/actions/prepare
|
||||
@@ -78,7 +70,7 @@ jobs:
|
||||
MINT_CLNREST_URL: https://localhost:3010
|
||||
MINT_CLNREST_RUNE: ./regtest/data/clightning-2/rune
|
||||
MINT_CLNREST_CERT: ./regtest/data/clightning-2/regtest/ca.pem
|
||||
MINT_CLNENABLE_MPP: false
|
||||
MINT_CLNREST_ENABLE_MPP: false
|
||||
run: |
|
||||
sudo chmod -R 777 .
|
||||
make test
|
||||
|
||||
19
.github/workflows/tests.yml
vendored
19
.github/workflows/tests.yml
vendored
@@ -23,21 +23,12 @@ jobs:
|
||||
poetry:
|
||||
name: Run (db ${{ inputs.mint-database }}, deprecated api ${{ inputs.mint-only-deprecated }})
|
||||
runs-on: ${{ inputs.os }}
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: cashu
|
||||
POSTGRES_PASSWORD: cashu
|
||||
POSTGRES_DB: cashu
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- name: Start PostgreSQL service
|
||||
if: contains(inputs.mint-database, 'postgres')
|
||||
run: |
|
||||
docker run -d --name postgres -e POSTGRES_USER=cashu -e POSTGRES_PASSWORD=cashu -e POSTGRES_DB=cashu -p 5432:5432 postgres:latest
|
||||
until docker exec postgres pg_isready; do sleep 1; done
|
||||
- name: Checkout repository and submodules
|
||||
uses: actions/checkout@v2
|
||||
- uses: ./.github/actions/prepare
|
||||
|
||||
Reference in New Issue
Block a user