[Bugfix:Developer] Fix flaky late submission Cypress test#12561
Merged
Conversation
Two root causes addressed:
1. Popup visibility race: `giveExtensions()` was asserting the team
extension popup existed but not that it was visible before clicking
inside it. Added `.should('be.visible')` to block until the popup
is fully shown.
2. UTC/server-timezone calendar day boundary mismatch: due dates were
generated with `getCurrentTime('threeDaysAgo')` using the CI
runner's local clock (UTC). The Submitty server runs in
America/New_York, so when CI runs in the early UTC hours the CI
calendar date is ahead of the server's, shifting the computed
"days late" count by 1 and causing the expected message strings to
not match.
Fix: replace `getCurrentTime('threeDaysAgo/twoDaysAgo')` for due
dates with a new `getDueDateString(N)` helper that computes N days
ago in the server's timezone and fixes the time at noon, avoiding
the midnight boundary. Late-day grant timestamps use a new
`getMorningDateString(N)` (6 AM) to guarantee they precede the noon
due date. Expected day counts in `SubmitAndCheckMessage` are now
derived from the `daysLate` parameter rather than hardcoded strings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12561 +/- ##
=========================================
Coverage 21.66% 21.66%
Complexity 9638 9638
=========================================
Files 268 268
Lines 36233 36233
Branches 486 486
=========================================
Hits 7849 7849
Misses 27902 27902
Partials 482 482
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove .claude from the .gitignore file
IDzyre
approved these changes
Mar 11, 2026
Member
IDzyre
left a comment
There was a problem hiding this comment.
Went over the code in person, and tests now pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this Change Important & Necessary?
The
late_submission_warning_messages.spec.jsCypress test was failing intermittently in CI. Two root causes:Popup visibility race:
giveExtensions()for team gradeables asserted#more_extension_popupexisted but not that it was visible, allowing clicks inside a hidden modal.UTC / server-timezone calendar-day mismatch: Due dates were generated using
getCurrentTime('threeDaysAgo')from the CI runner's local clock (UTC). The Submitty server runs inAmerica/New_York, so when CI runs between midnight–5 AM UTC the CI calendar day is one ahead of the server's. This shifts the computed "days late" count by 1, causing expected dialog message strings to not match (e.g., "3 day(s) late" when "4 day(s) late" was expected).What is the New Behavior?
getDueDateString(N)helper that computes N calendar days ago inAmerica/New_Yorkat noon, producing a stable date regardless of when (UTC time) CI runs.getMorningDateString(N)helper (6 AM in server timezone) for late-day grant timestamps to guarantee they always precede the noon due date.SubmitAndCheckMessage()to accept explicitdaysLateandextensionDaysnumeric parameters so expected confirmation messages are assembled dynamically rather than from hardcoded strings..should('be.visible')to the team extension popup assertion before clicking inside it.What steps should a reviewer take to reproduce or test the bug or new feature?
Run
late_submission_warning_messages.spec.jsin CI at different times of day (particularly near midnight UTC) and confirm all 4 previously intermittent failures no longer appear.Automated Testing & Documentation
This PR fixes the automated test itself. No additional tests needed; no documentation changes required.
Other information
Not a breaking change. No migrations. No security concerns.
🤖 This change was written by Claude Code