Skip to content

Fix flaky data-pull tests by truncating timestamps#8366

Merged
zachmargolis merged 2 commits intomainfrom
margolis-round-timestamps-flaky-test
May 9, 2023
Merged

Fix flaky data-pull tests by truncating timestamps#8366
zachmargolis merged 2 commits intomainfrom
margolis-round-timestamps-flaky-test

Conversation

@zachmargolis
Copy link
Contributor

🛠 Summary of changes

Follow-up to #8359 (comment)

Example spec failure, this works around it by truncating timestamps to have less drift (usually this comes from roundtrips to the database)

       (compared using ==)
       Diff:
       @@ -1,9 +1,9 @@
        [["uuid", "email", "confirmed_at"],
         ["16ccac88-7993-4cbe-9cc1-06ca84948720",
          "user246@example.com",
       -  2023-05-09 12:53:00.664757000 -0600],
       +  2023-05-09 12:53:00.664756000 -0600],

changelog: Internal, Tooling, Add script to streamline data pulls
@zachmargolis zachmargolis requested a review from mitchellhenke May 9, 2023 19:29
@zachmargolis zachmargolis marked this pull request as ready for review May 9, 2023 19:30
@zachmargolis zachmargolis changed the title Fix flaky tests by truncating timestamps Fix flaky data-pull tests by truncating timestamps May 9, 2023
Copy link
Contributor

@mitchellhenke mitchellhenke 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!

@zachmargolis
Copy link
Contributor Author

Thank you!

Ya no worries. I thought my original .round(6) would have fixed it but I guess... not! We can always round even more if needed or switch to like kind_of(Time) matchers in the future

@zachmargolis
Copy link
Contributor Author

Thank you!

Ya no worries. I thought my original .round(6) would have fixed it but I guess... not! We can always round even more if needed or switch to like kind_of(Time) matchers in the future

ended up going for that approach in c3c10d4

@zachmargolis zachmargolis merged commit fcaa9ed into main May 9, 2023
@zachmargolis zachmargolis deleted the margolis-round-timestamps-flaky-test branch May 9, 2023 23:05
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.

2 participants