FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make TC_POOLING_INTERVAL/sleep_time a float by samuelhwilliams · Pull Request #1 · samuelhwilliams/testcontainers-python · GitHub

Make TC_POOLING_INTERVAL/sleep_time a float - #1

Open
samuelhwilliams wants to merge 9 commits into
mainfrom
patch-2
Open

Make TC_POOLING_INTERVAL/sleep_time a float#1
samuelhwilliams wants to merge 9 commits into
mainfrom
patch-2

Conversation

Copy link
Copy Markdown
Owner

This config variable gets passed into time.sleep, which can work with ints and floats. Making this a float type allows polling intervals under a second, which can reduce startup times for containers that spin up very quickly.

I couldn't see any existing issue around this, and think it's probably only got a fairly small use case (but I do use it), so thought I'd throw up a PR as an easier way to just make the call on whether it's something you'd accept or not 🙇

alexanderankin and others added 8 commits July 2, 2025 07:10
makes mypy happier

---------

Co-authored-by: Roy Moore <roy@moore.co.il>
fix testcontainers#763

---------

Co-authored-by: Roy Moore <roy@moore.co.il>
Just a tiny addition to make large configurations easier to do in code.

---------

Co-authored-by: Roy Moore <roy@moore.co.il>
Co-authored-by: David Ankin <daveankin@gmail.com>
1. leftovers from a previous mypy refactor
```python
core/testcontainers/core/config.py:42: error: Redundant cast to "str"  [redundant-cast]
            socket_path = cast("str", socket_path)
 ```
 
 Post fix:
 ```bash
#poetry run mypy --config-file pyproject.toml core
Success: no issues found in 36 source files
```

2. add mypy check to the CI under lint, also create a simple report if
something is wrong.
Add OpenFGA testcontainer module

---------

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
Co-authored-by: David Ankin <daveankin@gmail.com>
🤖 I have created a release *beep* *boop*
---


##
[4.12.0](testcontainers/testcontainers-python@testcontainers-v4.11.0...testcontainers-v4.12.0)
(2025-07-21)


### Features

* **main:** New Testcontainers Python Docs Site
([testcontainers#822](testcontainers#822))
([a6bdf0e](testcontainers@a6bdf0e))
* make config monkeypatchable, fix config related startup issues
([testcontainers#833](testcontainers#833))
([ff6a32d](testcontainers@ff6a32d))
* **modules:** add OpenFGA module
([testcontainers#762](testcontainers#762))
([0b7b482](testcontainers@0b7b482))
* set multiple variables via keyword args
([testcontainers#804](testcontainers#804))
([1532df5](testcontainers@1532df5))


### Bug Fixes

* **core:** mypy
([testcontainers#810](testcontainers#810))
([b816762](testcontainers@b816762))
* Enable mypy in the CI
([testcontainers#842](testcontainers#842))
([ef65bd1](testcontainers@ef65bd1))
* just use the getLogger API and do not override logger settings
([testcontainers#836](testcontainers#836))
([f467c84](testcontainers@f467c84))


### Documentation

* missing compose html from old docs
([testcontainers#776](testcontainers#776))
([d749fc6](testcontainers@d749fc6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Aligns testcontainers-python with the testcontainers community standard
wait strategy pattern used across Java, Go, and other implementations.
This provides a consistent developer experience and better
maintainability.

## Examples

From:

```
wait_for_logs(container, "Test Sample Image")
```

To:

```
from testcontainers.core.wait_strategies import LogMessageWaitStrategy

container.waiting_for(LogMessageWaitStrategy("Server started"))
```

## Backward Compatibility
No breaking changes - all existing code continues working
Deprecation warnings added to wait_for_logs() and
@wait_container_is_ready
Clear migration path provided in warning messages


### New:
core/testcontainers/core/wait_strategies.py - Strategy implementations
core/tests/test_wait_strategies*.py - Comprehensive test coverage
### Modified:
core/testcontainers/core/container.py - Added waiting_for() method
core/testcontainers/compose/compose.py - Added compose wait strategy
support
core/testcontainers/core/waiting_utils.py - Base classes and protocol

## Future Strategies to quickly follow
Foundation enables community-standard wait strategies:
HttpWaitStrategy, HealthcheckWaitStrategy, PortWaitStrategy,
CompositeWaitStrategy

## Testing
Unit tests with parameterized scenarios
Integration tests with real Docker containers
Protocol compliance verification
Backward compatibility validation
This config variable gets passed into `time.sleep`, which can work with ints and floats. Making this a float type allows polling intervals under a second, which can reduce startup times for containers that spin up very quickly.
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL