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
Test retry of failed initial db connection #1269
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1269 +/- ##
==========================================
- Coverage 75.11% 74.62% -0.50%
==========================================
Files 298 298
Lines 26324 27233 +909
==========================================
+ Hits 19774 20322 +548
- Misses 6550 6911 +361
Continue to review full report at Codecov.
|
tests/backend/test_postgres_db.py
Outdated
postgresql_url = re.sub( | ||
":(\\d+)/", lambda m: f":{str(int(m.group()[1:-1])+1)}/", postgresql_url | ||
) | ||
with pytest.raises(OSError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with pytest.raises(OSError) as exc:
to then test str(exc.value) == "<error message about the connection>"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you forgot to push the changes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, forgot one of the UT...
tests/backend/test_postgres_db.py
Outdated
): | ||
postgresql_url = f"postgresql://localhost:{unused_tcp_port}/dummy" | ||
with pytest.raises(OSError): | ||
with trio.fail_after(3 * 3 + 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😿
tests/backend/test_postgres_db.py
Outdated
postgresql_url = re.sub( | ||
":(\\d+)/", lambda m: f":{str(int(m.group()[1:-1])+1)}/", postgresql_url | ||
) | ||
with pytest.raises(OSError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you forgot to push the changes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfection.
Tests for #1258 (review)