Skip to content

Conversation

@adamsachs
Copy link
Contributor

@adamsachs adamsachs commented Nov 17, 2025

Description Of Changes

Fixes a timing issue for some privacy request tests that occurred if they ran right on the border of midnight (00:00) UTC, e.g. in this CI run here.

Code Changes

  • Use freezegun to freeze time on these tests and avoid potential timing issues

Steps to Confirm

  1. We'd need to run a test run at 'just' the right time again (right before 00:00 UTC) to be sure, but if this passes CI as-is, I think it's pretty safe to assume it'll fix the problematic case too, and we should merge!

NOTE: CI did fail on attempt #1 on this PR with the following test error:

ERROR tests/ops/api/v1/endpoints/privacy_request/test_privacy_request_logs.py::TestGetTestPrivacyRequestLogs::test_get_test_logs_only_includes_test_source

this isn't directly related to the changes on this PR, but it's also close enough that i can't be 100% sure i'm not introducing a test regression here. that being said, @erosselli and i couldn't find any reason why the changes here would have caused that failure, so we suspect it's always been a flaky test and i just happened to hit the failure case on the CI run here...

CI did not fail on this test on attempt #2, and also didn't fail on the 3.9 python run, so our inclination is to just consider this a coincidence and go ahead and merge this improvement 👍

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ignored Ignored Nov 17, 2025 2:43am
fides-privacy-center Ignored Ignored Nov 17, 2025 2:43am

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.33%. Comparing base (14ab486) to head (932babf).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6981   +/-   ##
=======================================
  Coverage   87.33%   87.33%           
=======================================
  Files         525      525           
  Lines       34458    34458           
  Branches     3967     3967           
=======================================
  Hits        30093    30093           
  Misses       3501     3501           
  Partials      864      864           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adamsachs adamsachs marked this pull request as ready for review November 17, 2025 18:33
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 17, 2025

Greptile Summary

  • Uses freezegun library to freeze time in two parametrized tests (test_get_privacy_requests_sets_days_left and test_privacy_request_search_sets_days_left) to prevent timing issues when tests run near midnight UTC
  • Import added at top of file following proper import conventions

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The change correctly implements freezegun to fix a legitimate timing issue in tests, with proper import placement and correct decorator usage. Minor style suggestion about using a more obviously historical date doesn't affect functionality.
  • No files require special attention

Important Files Changed

Filename Overview
tests/ops/api/v1/endpoints/privacy_request/test_privacy_request_endpoints.py Added freezegun to freeze time in two parametrized tests to fix timing issues that occurred when tests ran near midnight UTC

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

),
],
)
@freeze_time("2025-11-17 12:00:00")
Copy link
Contributor

Choose a reason for hiding this comment

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

style: using a date in 2025 could be confusing - prefer a clearly historical date like "2020-01-15 12:00:00" to make it obvious this is test fixture data

),
],
)
@freeze_time("2025-11-17 12:00:00")
Copy link
Contributor

Choose a reason for hiding this comment

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

style: using a date in 2025 could be confusing - prefer a clearly historical date like "2020-01-15 12:00:00" to make it obvious this is test fixture data

@adamsachs adamsachs added this pull request to the merge queue Nov 17, 2025
Merged via the queue into main with commit 2cad5cb Nov 17, 2025
99 of 101 checks passed
@adamsachs adamsachs deleted the asachs/fix-privacy-request-timing-tests branch November 17, 2025 19:13
jjdaurora pushed a commit that referenced this pull request Dec 5, 2025
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