Skip to content

Fix Tests random failure #165

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

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

LucaRainone
Copy link
Contributor

@LucaRainone LucaRainone commented Oct 17, 2023

I noticed that randomly test fails on my machine (docker hosted on macos 13). This is (probably) caused by 2 issues:

  1. missed await on query("BEGIN")
  2. the use of TRUNCATE on each test.

as explained here (https://www.postgresql.org/docs/current/mvcc-caveats.html) TRUNCATE is not MVCC-safe (Multi-Version Concurrency Control).

This PR adds the missing await and converts all the TRUNCATE users in DELETE FROM "users" WHERE TRUE.

Because the tests inside the req-initialization file do not verify user IDs, the proposed query has the same effect as a TRUNCATE in this context

Checklist

Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

Thank you
LGTM

@mcollina mcollina merged commit bd81d51 into fastify:master Oct 18, 2023
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