Skip to content

Use Advanceable System Clock in Tests #3870

Description

@alexanderkiel

Part of the effort to eliminate all Thread/sleep calls from tests (see #3863 and PR #3866).

Tests using system-clock-config sleep between 200 ms and 2000 ms only to obtain distinguishable lastUpdated/_since instants from the real InstantSource. Replacing :blaze.test/system-clock with a mutable clock the test can advance explicitly removes 14 sleeps:

  • modules/db/test/blaze/db/api_test.clj:10529,10531,10676,10678,10836,10838 — history tests "using since"
  • modules/interaction/test/blaze/interaction/history/instance_test.clj:520,524
  • modules/interaction/test/blaze/interaction/history/type_test.clj:457,461
  • modules/interaction/test/blaze/interaction/history/system_test.clj:497,501
  • modules/operation-patient-everything/test/blaze/operation/patient/everything_test.clj:1030,1034

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions