test: fix flaky regtest (#2616)

* add log for invoice success
* add internal flag
* sleeping inside the tasks to not block
* sleep was wrong decrease wait time
This commit is contained in:
dni ⚡
2024-07-31 11:41:19 +02:00
committed by GitHub
parent b41705167f
commit ffba71c0ce
5 changed files with 34 additions and 24 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ def register_http_exception_handler(app: FastAPI):
def register_payment_error_handler(app: FastAPI):
@app.exception_handler(PaymentError)
async def payment_error_handler(request: Request, exc: PaymentError):
logger.error(f"PaymentError: {exc.message}, {exc.status}")
logger.error(f"{exc.message}, {exc.status}")
return JSONResponse(
status_code=520,
content={"detail": exc.message, "status": exc.status},
@@ -100,7 +100,7 @@ def register_payment_error_handler(app: FastAPI):
def register_invoice_error_handler(app: FastAPI):
@app.exception_handler(InvoiceError)
async def invoice_error_handler(request: Request, exc: InvoiceError):
logger.error(f"InvoiceError: {exc.message}, Status: {exc.status}")
logger.error(f"{exc.message}, Status: {exc.status}")
return JSONResponse(
status_code=520,
content={"detail": exc.message, "status": exc.status},