Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow concurrent use of welkin clients #67

Merged
merged 8 commits into from
Sep 1, 2023

Conversation

jdiaz5513
Copy link
Contributor

Without this patch any attempt to use the Welkin client concurrently will result in a file access error.

This is because of the temporary file created for auth: the shelf library makes no attempt to lock the file beforehand and cannot handle concurrent write access.

I added portalocker as a cross-platform way to obtain a lock (on a separate temp file) while accessing that DB file.

I've also added pytest-xdist to make sure the tests do not fail when run in parallel (they did before!).

There is one newly skipped test that fails intermittently (~1 out of 20 times). I'm not sure what to do about it, or if it is even safe to skip. We're trying to add parallelism to our own test suite so that particular issue may come to bite us anyway. It is interesting that it's only happening to a single test.

Copy link
Contributor

@edcohen08 edcohen08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM - appreciate this change. Only thing is if you could figure out why that test is failing?

@jdiaz5513
Copy link
Contributor Author

jdiaz5513 commented May 15, 2023

I can't reproduce the failing test anymore after hundreds of test runs; looks like this is safe to merge!

@edcohen08
Copy link
Contributor

Great, thank you @jdiaz5513 !

@edcohen08
Copy link
Contributor

edcohen08 commented May 16, 2023

@jdiaz5513 can you run poetry add urllib3@1.26.12, it was upgraded with portalocker and is breaking our tests with vcr

@jdiaz5513
Copy link
Contributor Author

@edcohen08 sorry that took me a bit; let's see if that fixes the packaging!

@edcohen08
Copy link
Contributor

@edcohen08 sorry that took me a bit; let's see if that fixes the packaging!
@jdiaz5513
also have been very slow to come back to this, can you check actually it seems like the entire project packages and lock was overwritten, maybe there was an environment clash? if you could just make sure you're using the poetry.lock from dev and then only adding portalocker

@samamorgan samamorgan changed the base branch from main to develop July 5, 2023 17:28
@gone
Copy link
Member

gone commented Aug 9, 2023

is this good to merge? it looks like the changes are pretty small

@samamorgan
Copy link
Collaborator

is this good to merge? it looks like the changes are pretty small

Yep, I think it should be. Just needs a review and approval.

@gone gone merged commit 2e89f79 into Lightmatter:develop Sep 1, 2023
@samamorgan samamorgan deleted the juliand/zst-883 branch January 8, 2024 19:36
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.

4 participants