-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Chore: Attempt to reduce flakiness in integration tests #97247
Conversation
3a68b94
to
44435a7
Compare
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.
LGTM
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.
I agree that we can use it for the tests without running in synchronous mode, but from the change, it would also affect users that currently have wal enabled. We should only disable it with OFF (0)
during testing, and continue to have sync on the FULL (2)
setting by default, so that a host crash doesn't corrupt their data.
Many of our users rely on stable, non-ephemeral SQLite deployments in their homelabs or any smaller setup, and we should avoid unnecessarily degrading their experience.
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.
NVM, just saw it's only the testdb, good work 👍
* sqlstore/sqlutil: set sync=OFF for sqlite in tests if wal=true * testinfra: set max open/idle conn to 2 to match e2e tests
What is this feature?
1. In integration tests, set
sync=OFF
if_journal_mode=WAL
is set.Why? From the SQLite docs:
Even though it might corrupt the database in case of OS crashes, since these are supposed to be ephemeral databases, these characteristics are not needed. The default is
FULL (2)
.2. Limit
max_open_conn
andmax_idle_conn
to2
. This matches the settings used in E2E tests.Why?
It seems that limiting the max connections (especially
open
) improves the locking errors.We were previously not setting the
max_open_conn
at all. This might make some tests slower, but I need to compare them closely.Why do we need this feature?
This is an attempt to reduce flakiness in integration tests that are failing with
database is locked
errors.Who is this feature for?
Contributors.
Which issue(s) does this PR fix?:
N/A