Skip to content

phoenixframework/phoenix

Back Eliminate Process.sleep from integration tests (#6830)

Commit details

Eliminate Process.sleep from integration tests (#6830)

Description

Previously, consecutive generator commands in integration tests (such as `phx.gen.auth` followed by `phx.gen.live` or multiple scoped generators) invoked `Process.sleep(1500)` to ensure that newly generated migrations received distinct 1-second timestamp versions. In aggregate across all tests, these blind sleeps introduced unnecessary idle latency to test runs. This adds `adjust_migration_timestamps/1`: - Adjusts timestamps of existing migration files on disk to deterministic, sequentially ordered timestamps in the past. - Allows subsequent generators to produce fresh, non-colliding migration versions immediately without sleeping. - Removes all 8 instances of `Process.sleep(1500)` across integration tests.

Metadata

Author
Rodolfo Carvalho rhcarvalho@gmail.com
Committed
Commit

Contributors

  • Rodolfo Carvalho rhcarvalho@gmail.com Author