litestar-org / litestar-org/pytest-databases

Enhancement: implement healhchecks

Open
#160 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
59
Forks
11
PR merge metrics
No merged PRs in 30d

Description

### Summary

Hello! Thanks for such a convenient project!

I was looking through the codebase and saw that healthchecks are implemented in python. Today I wanted to make a fix to a project that uses pytest-databases, but mssql failed to start.

https://github.com/litestar-org/advanced-alchemy/actions/runs/33677096148/job/100404437042?pr=794

In order to make sure that the container is started normally, we can start using docker healthchecks. So it's basically almost the same approach as you do right now, but without relying on python and with improved accuracy on intervals.

I personally have few projects that use healthchecks for side container and starting using them greatly improved stability.

Here are some examples:
* https://github.com/s3rius/cont/blob/master/my_cont/__main__.py
* https://github.com/s3rius/FastAPI-template/blob/master/fastapi_template/template/%7B%7Bcookiecutter.project_name%7D%7D/docker-compose.yml

This mechanism will make it easier to maintain the codebase and could potentially improve stability.

What do you think about the following enhancement?

### Basic Example

_No response_

### Drawbacks and Impact

_No response_

### Unresolved questions

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing Python healthcheck implementation and the database container definitions in pytest-databases. Review the linked Docker healthcheck examples and determine how the mssql container currently starts. Done means container readiness uses Docker healthchecks instead of relying on Python, with startup behavior covered for the affected database fixtures.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
databases, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.