8000 fix(test): use relative future dates in ICS test to avoid time bombs by mwoods79 · Pull Request #156 · huddlz-hq/huddlz · GitHub
[go: up one dir, main page]

Skip to content

fix(test): use relative future dates in ICS test to avoid time bombs - #156

Merged
mwoods79 merged 1 commit into
mainfrom
fix/ics-test-future-date
May 2, 2026
Merged

mwoods79 merged 1 commit into
mainfrom
fix/ics-test-future-date

Conversation

@mwoods79
@mwoods79 mwoods79 commented May 2, 2026
Copy link
Copy Markdown
Contributor

Summary

The `ics_test.exs` "event_for/1 carries the huddl identity and timing" test hardcoded `date: ~D[2026-05-01], start_time: ~T[14:00:00]`. On May 1 2026 (today), any test run after 14:00 UTC produced a date+time in the past, which the huddl create action's `FutureDateValidation` correctly rejects — failing the test with what looked like a "flaky generator" failure.

It was never the generator. It was a literal expired date.

Fix

  • Replace both hardcoded dates in this file with `Date.add(Date.utc_today(), N)`.
  • Compute the expected `DTSTART` / `DTEND` substrings from the same date so the assertions still verify exact formatting.

Why it shows up everywhere

Every PR opened today has CI failing on this test, even though their changes are unrelated. Merging this first will let the other open PRs (#146, #147, #151, #153, #155) go green.

Closes #152

Test plan

  • `mix test test/huddlz/notifications/ics_test.exs` — 87 tests pass
  • `mix precommit` — full suite passes (1031 tests, 0 failures)

The 'ics carries the huddl identity and timing' test hardcoded
date: ~D[2026-05-01], start_time: ~T[14:00:00] — which on May 1
2026 became a date in the past after 14:00 UTC, causing the
huddl create action's FutureDateValidation to reject the
generator and fail the test.

Replace both hardcoded dates in this file with
Date.add(Date.utc_today(), N), and compute the expected
DTSTART/DTEND substrings from the same date so the assertions
stay accurate.

Closes #152
@mwoods79
mwoods79 merged commit 9530a46 into main May 2, 2026
1 check passed
@mwoods79
mwoods79 deleted the fix/ics-test-future-date branch May 2, 2026 02:24
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.

Flaky test: ICSTest event_for/1 fails when generator produces non-future dates

1 participant

0