fix(ci): stabilize regtest Postgres tests and regtest workflows#966
Open
b-l-u-e wants to merge 1 commit intocashubtc:mainfrom
Open
fix(ci): stabilize regtest Postgres tests and regtest workflows#966b-l-u-e wants to merge 1 commit intocashubtc:mainfrom
b-l-u-e wants to merge 1 commit intocashubtc:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #966 +/- ##
==========================================
+ Coverage 74.90% 75.05% +0.14%
==========================================
Files 99 99
Lines 11685 11714 +29
==========================================
+ Hits 8753 8792 +39
+ Misses 2932 2922 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
6a2778b to
55fa2b2
Compare
e4474c3 to
d466744
Compare
d466744 to
2d9510c
Compare
f41e66c to
0a0f189
Compare
0a0f189 to
aae9635
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
10‑minute job timeout – Jobs were cancelled mid‑pytest (operation canceled), so often never saw a real pass/fail. so i raise timeout-minutes so the suite can finish.After the timeout was raised – Many runs completed and showed ~3–4 minutes for tests/wallet / tests/mint in some matrix cells saw tests. So duration was under the old 10‑minute cap in those cases; the cap was still wrong for slower/heavier rows or when setup + tests add up.
then noticed one matrix run hit DeadlockDetectedError on DROP SCHEMA public CASCADE in the ledger fixture
Improves reliability of mint tests against PostgreSQL in CI, deduplicates regtest setup via a shared composite action, and hardens Postgres orchestration (service containers, digest-pinned image, consistent cleanup). Raises job timeouts so slow Lightning/regtest runs are not killed mid-suite, and fixes test assertions and DB cleanup so Postgres matrix jobs pass consistently.
Tests (
tests/conftest.py)DROP SCHEMA public CASCADEwith a TRUNCATE-based cleanup that keeps the schema and avoids heavy locking/deadlock issues.quote_ident(no%in SQL strings) so Postgres queries stay valid afterConnection.rewrite_querydoubles%for SQLAlchemy.dbversions, so migration version rows stay aligned with the existing schema; avoidsADD COLUMN … already existswhen migrations would otherwise re-run after truncate.print("teardown")from the ledger fixture.Tests (
tests/mint/test_mint_melt.py)assert_errwith optionalcontains=Truefor substring checks; default remains exact match.test_mint_pay_with_duplicate_checking_id:await assert_err(...)and usecontains=Trueso wrapped wallet errors (e.g. mint error prefix) still match.CI
.github/actions/regtest-run: clone/start regtest; for Postgres, create a unique DB per run/backend (MINT_TEST_DATABASE), runmake test-mint/test-wallet,pg_terminate_backend+DROP DATABASEcleanup with retries, dump Postgres logs on failure.regtest-mint.ymlandregtest-wallet.ymluse GitHub service containers (health-checked) instead of ad-hocdocker run, withuse-github-postgres-serviceso the app talks tolocalhost:5432and admin ops usepsql+ sharedPGADMINURL. Thedocker runpath remains for other callers that keep the default.REGTEST_POSTGRES_IMAGEis digest-pinned; passpostgres-imageinto the composite soservices.postgres.image, fallbackdocker run, and log capture all reference the same image ref.regtest-mint.yml/regtest-wallet.yml:timeout-minutes: 120, upload artifacts on failure, Codecov withif: always()where applicable.