Skip to content

Fixes #39792 - Stabilize DateTimePicker future-only tests - #11280

Open
jakduch wants to merge 1 commit into
theforeman:developfrom
jakduch:fix/datetime-picker-midnight-test
Open

jakduch wants to merge 1 commit into
theforeman:developfrom
jakduch:fix/datetime-picker-midnight-test

Conversation

@jakduch

@jakduch jakduch commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

The future-only DateTimePicker test adds one hour to the current time but formats the date from the original value. Between 23:00 and midnight this produces a timestamp on the wrong date and fails deterministically; the corresponding past-time case has the inverse problem shortly after midnight.

Freeze the system time at midday for the future-only validation group so both cases remain on the intended date. Restore real timers after each test.

Tests after rebasing on current develop:

  • focused DateTimePicker suite: 14 passed using the existing dependency cache (local Node 26; CI uses Node 22);
  • targeted ESLint with ignored test files explicitly enabled;
  • git diff --check.

The same unmodified test also failed in both JavaScript jobs of #11334 at 23:04 UTC on October 27.

Fixes #39792

AI assistance: Codex. Project signature: GPT_5.6 Sol.

@github-actions github-actions Bot added the UI label Sep 25, 2026
@jakduch
jakduch force-pushed the fix/datetime-picker-midnight-test branch from 73c47f2 to aeb0845 Compare September 25, 2026 05:07
@jakduch jakduch changed the title Refs #38962 - Stabilize DateTimePicker future-only tests Fixes #39792 - Stabilize DateTimePicker future-only tests Sep 25, 2026
@jakduch

jakduch commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

The failing HostgroupJSTest#test_0002_creates a hostgroup with provisioning data is unrelated to this PR: this change only touches the DateTimePicker test, while the integration job timed out in the unchanged hostgroup test on all three attempts. I tried to rerun the complete workflow, but GitHub requires repository admin rights.

@jakduch

jakduch commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

The failing integration job is the shared HostgroupJSTest#test_0002_creates a hostgroup with provisioning data timeout, not a failure in this PR. It reproduced independently in #11284. I opened #11291 (Redmine #39803) to make the test synchronize on the post-submit redirect and use a unique name across retries.

@jakduch

jakduch commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on current develop. The unchanged future-time test failed again in #11334 at 23:04 UTC: adding an hour crossed midnight but the formatted value kept the previous date.

This fix freezes the validation group's clock at midday. The focused DateTimePicker suite passed all 14 tests locally using the existing dependency cache (Node 26; CI uses Node 22). Full CI is running on the rebased commit.

Freeze the validation tests at midday so their same-day past and future
times do not cross midnight depending on the runner's clock.

AI assistance: Codex. Project signature: GPT_5.6 Sol.
@jakduch
jakduch force-pushed the fix/datetime-picker-midnight-test branch from 073d5e6 to d725312 Compare October 28, 2026 07:08
@jakduch

jakduch commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

The DateTimePicker JavaScript tests and both Foreman Ruby unit jobs passed. The remaining failure was in the dependent Katello Ruby 3.3 suite: AlternateContentSourceRefreshTest#test_yum_refresh_updates_remote could not match a POST /pulp/api/v3/acs/rpm/rpm/ against its VCR cassette. This PR only changes the DateTimePicker test's clock.

I retriggered the full pipeline once with an unchanged code tree.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant