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

move all redis session creation to factory #4365

Merged

Conversation

pbugni
Copy link
Collaborator

@pbugni pbugni commented Mar 4, 2024

This started as an attempt to mock redis for consistent testing outside of normal behavior.

That attempt failed thus far, but to capture all redis session initialization behind a single function still seems of value, for future work and easier debugging.

This PR includes a fence around the cache clearing redis communication necessary in a patient's timeline rebuild, to only hit redis when not under test. Necessary as otherwise, we experience a deadlock situation where tables can't be dropped between test runs, as postgres believes a deadlock condition exists.

@pep8speaks
Copy link

pep8speaks commented Mar 4, 2024

Hello @pbugni! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 3:1: E302 expected 2 blank lines, found 1

Line 767:80: E501 line too long (89 > 79 characters)
Line 767:90: W291 trailing whitespace
Line 768:80: E501 line too long (81 > 79 characters)

Comment last updated at 2024-03-05 21:57:21 UTC

@pbugni pbugni marked this pull request as ready for review March 5, 2024 01:29
@pbugni pbugni requested a review from ivan-c March 5, 2024 01:29
@pbugni pbugni force-pushed the feature/timeline-beyond-withdrawal branch from eb61f6c to dc1751d Compare March 5, 2024 01:57
Copy link
Member

@ivan-c ivan-c left a comment

Choose a reason for hiding this comment

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

looks good, thanks!

portal/migrations/versions/3c871e710277_.py Outdated Show resolved Hide resolved
portal/models/qb_timeline.py Show resolved Hide resolved
@pbugni pbugni force-pushed the feature/redis-test-harness branch from 5afdeac to 5665dec Compare March 5, 2024 21:57
@pbugni pbugni merged commit 834a9ae into feature/timeline-beyond-withdrawal Mar 5, 2024
1 of 2 checks passed
@pbugni pbugni deleted the feature/redis-test-harness branch March 5, 2024 21:58
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.

3 participants