Skip to content

[DT-4324][risk=no] Use the database clock in the DAR expiration test - #3298

Draft
rushtong wants to merge 1 commit into
developfrom
DT-4324-expiration-test-clock
Draft

rushtong wants to merge 1 commit into
developfrom
DT-4324-expiration-test-clock

Conversation

@rushtong

Copy link
Copy Markdown
Contributor

Addresses

https://broadworkbench.atlassian.net/browse/DT-4324

Summary

DataAccessRequestDAOTest.testFindApprovedDARsByDatasetIdLastsTheExpirationDuration failed at times on a local computer. I found the failure during the test runs for #3297.

  • The case 8760, 0 set a submission date of exactly 8760 hours before the time of the JVM clock.
  • The query compares that date with now() from the database clock.
  • The case failed when the database clock was behind the JVM clock. On a Mac, the database runs in the Docker virtual machine, which has a different clock.

The test now reads now() from the database and calculates the submission date from that time. Thus the test uses one clock. This changes only test code.

This pull request does not depend on the prod upgrade. It can merge now.

Test results

The test passed 3 times on postgres:16.10-alpine and 3 times on postgres:18.7-alpine. The failure was not regular, so these runs do not prove the correction. The proof is that the test no longer uses the JVM clock for the date.


Have you read CONTRIBUTING.md lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant