$ the-wire · showcase
Phoenix CI drops Process.sleep blind waits; Elixir fixes Hex version check
By RepoJournal · Filed · About Elixir & Phoenix
Phoenix integration tests no longer sleep 1500ms between generators, and Elixir fixes a swapped condition in its Hex version check.
Phoenix eliminated the blind `Process.sleep(1500)` calls that its integration tests used to guarantee distinct migration timestamps. New `adjust_migration_timestamps/1` rewrites generated migration files on disk to deterministic, sequential versions, removing idle latency from test runs [1]. Separately, CI runs those integration tests on an `ubuntu-24.04` host runner instead of an Alpine Docker container, adding caching for `integration_test/deps` and `_build` to avoid recompiling roughly 50 dependencies each run [2].
Elixir fixed a swapped condition in its Hex version check, correcting a logic error in the commit that closes issue #15847 [3]. The fix matters for any tooling path that relies on that version comparison.
A separate optimization adds fast paths for non-empty lists in `Enum.min_max/1,2`, matching the fast-path behavior of `Enum.min/1,2` and `Enum.max/1,2`; direct traversal avoids closure and cons-cell allocations [4]. This is a performance improvement with no behavior change, though the author notes it could be closed if "the added complexity doesn't worth it" [4].
Action items
- → Monitor the swapped Hex version check fix; it will land in an upcoming Elixir release elixir-lang/elixir [monitor]
- → Review the Enum.min_max/1,2 fast-path optimization if you benchmark hot Enum calls elixir-lang/elixir [plan]
References
- [1] Eliminate Process.sleep from integration tests (#6830) ↗ phoenixframework/phoenix
- [2] Run integration tests on host runner in CI (#6831) ↗ phoenixframework/phoenix
- [3] Fix swapped Hex version check condition, closes #15847 ↗ elixir-lang/elixir
- [4] Optimize Enum.min_max/1,2 for non-empty lists ↗ elixir-lang/elixir