Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Pin MongoDB images and improve test coverage for maintained versions #448

Merged
merged 6 commits into from
Apr 2, 2024

Conversation

alexanderankin
Copy link
Member

for some reason this causes an issue, see #401 for details

@balint-backmaker
Copy link
Contributor

Funny, never would have occurred to me to call the init function! I am not sure how pythonic it is to do this manually since __init__ would have been called when you call MongoClient()

Could this be a version glitch where we didn't specify the version of the mongo dependency accurately enough, therefore it sucked up an unknown version?

(remind me to create an issue for dependency management too, we should install renovate on the repo sooner than later)

@alexanderankin
Copy link
Member Author

none of my research ever turned up anything to explain how this fixes the issue but @covatic-john claims that this fixes the issue in this comment - #401 (comment)

@alexanderankin
Copy link
Member Author

looking at this PR once a week and cannot bring myself to merge it. it makes no sense.

@covatic-john i did merge a different PR where it turns out there was no waiting at all for mongo container (i mean it usually starts in under 1sec in my experimence) so maybe it was that?

maybe i will change my mind one of these weeks. at present, we have no indication that the issue went away, so leaving open.

@santi
Copy link
Collaborator

santi commented Apr 2, 2024

Having to call the __init__ function twice points to some kind of race condition where the container was not ready before instantiating a client. I've revamped the MongoDB module with more tests and pinned versions in test images, for more reproducible behavior.

There are no traces of the behavior happening in version 5.0+ in any of the tests, so I'll merge this now and see if it persist. If it does, then we should look into the platform arch for the users with problems and see if it might be the same errors as in #457, where the connection string itself might be formatted incorrectly.

@santi santi changed the title fix: MongoClient __new__ exception fix: Pin MongoDB images and improve test coverage for maintained versions Apr 2, 2024
@santi santi merged commit b5c7a1b into main Apr 2, 2024
13 checks passed
@santi santi deleted the fix_mongo_client_dunder_new_exception branch April 2, 2024 10:50
alexanderankin pushed a commit that referenced this pull request Apr 2, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.3.1](testcontainers-v4.3.0...testcontainers-v4.3.1)
(2024-04-02)


### Bug Fixes

* **core:** env vars not being respected due to constructor call
([#524](#524))
([4872ea5](4872ea5)),
closes
[#521](#521)
* Pin MongoDB images and improve test coverage for maintained versions
([#448](#448))
([b5c7a1b](b5c7a1b))

---
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>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants