Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Infinite loop in timezones on the negative side of UTC #12063

Merged
merged 11 commits into from
Oct 25, 2023

Conversation

emrysal
Copy link
Contributor

@emrysal emrysal commented Oct 24, 2023

What does this PR do?

Test by:

  • Run new tests against old code; observe there's an infinite loop
  • Then run tests against updated code.

@vercel
Copy link

vercel bot commented Oct 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai ❌ Failed (Inspect) Oct 25, 2023 11:51am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 11:51am
qa 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 11:51am
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 11:51am
cal ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 11:51am
cal-demo ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 11:51am
ui ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 11:51am

@emrysal emrysal requested a review from keithwillcode October 24, 2023 16:45
@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes!

@emrysal emrysal requested a review from zomars October 24, 2023 16:45
@zomars zomars added the core area: core, team members only label Oct 24, 2023
@emrysal emrysal requested a review from CarinaWolli October 24, 2023 16:45
@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@deploysentinel
Copy link

deploysentinel bot commented Oct 24, 2023

Current Playwright Test Results Summary

✅ 208 Passing - ⚠️ 7 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/25/2023 11:54:03am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: db0a11a

Started: 10/25/2023 11:50:00am UTC

⚠️ Flakes

📄   apps/web/playwright/login.2fa.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 1Initial Attempt
0.34% (1) 1 / 296 run
failed over last 7 days
29.73% (88) 88 / 296 runs
flaked over last 7 days

📄   apps/web/playwright/event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests user Different Locations Tests can add Attendee Phone Number location and book with it
Retry 1Initial Attempt
0% (0) 0 / 306 runs
failed over last 7 days
3.59% (11) 11 / 306 runs
flaked over last 7 days

📄   apps/web/playwright/change-username.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Change username on settings User can change username to include periods(or dots)
Retry 1Initial Attempt
0% (0) 0 / 97 runs
failed over last 7 days
34.02% (33) 33 / 97 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 2Retry 1Initial Attempt
7.21% (22) 22 / 305 runs
failed over last 7 days
90.16% (275) 275 / 305 runs
flaked over last 7 days

📄   apps/web/playwright/teams.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams Non admin team members cannot create team in org
Retry 1Initial Attempt
0.34% (1) 1 / 298 run
failed over last 7 days
20.81% (62) 62 / 298 runs
flaked over last 7 days

📄   apps/web/playwright/webhook.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
FORM_SUBMITTED on submitting team form, triggers team webhook
Retry 1Initial Attempt
0.33% (1) 1 / 299 run
failed over last 7 days
12.37% (37) 37 / 299 runs
flaked over last 7 days

📄   apps/web/playwright/availability.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Availablity tests Availability pages
Retry 1Initial Attempt
0% (0) 0 / 305 runs
failed over last 7 days
1.31% (4) 4 / 305 runs
flaked over last 7 days

View Detailed Build Results


@zomars
Copy link
Member

zomars commented Oct 24, 2023

Can we check with e2e are failing?

@zomars
Copy link
Member

zomars commented Oct 24, 2023

Maybe unrelated but I'm getting this test failure locally. cc @CarinaWolli I think I've shared this with you before

image

@CarinaWolli
Copy link
Member

Maybe unrelated but I'm getting this test failure locally. cc @CarinaWolli I think I've shared this with you before

image

@zomars That's unrelated, investigating right now. Somehow dayjs has some different results depending what tz your system is running on

@emrysal
Copy link
Contributor Author

emrysal commented Oct 24, 2023

@zomars not entirely unrelated, turns out after the test the system time wasn't reverted, and some of our e2e tests are failing on the new system time - I'm pushing a fix to revert to real system time for now but it's a problem that that test fails in different system times.

@alishaz-polymath
Copy link
Member

The new test passes for me for both old and updated code 😮

@hariombalhara
Copy link
Member

Same here, but the bug is actually fixed. Trying to see if I can fix the test.

@hariombalhara
Copy link
Member

@emrysal I found that we need to fake the timezone using TZ env variable in Vitest.

So, I added the concept of timeZone dependent tests and marked these tests as timezone dependent by having an extension test.timezone.ts

Doing this I was able to replicate that infinite loop scenario in main with the tests. But even with the fix, I see some expectations mismatch here.

Passing with Asia/Kokata
image

Failing with America/Los_Angeles
Screenshot 2023-10-25 at 1 01 57 PM

Also, feel free to revert the commit, if it's not the right approach. I was debugging and just went ahead with this approach.

@emrysal
Copy link
Contributor Author

emrysal commented Oct 25, 2023

@hariombalhara thanks! Turned out the test was broken and casting to UTC - fixed the cast and pushed.

@keithwillcode keithwillcode self-requested a review October 25, 2023 11:42
keithwillcode
keithwillcode previously approved these changes Oct 25, 2023
Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated code changes look good. Will wait for tests to pass to merge.

Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested Locally, the new test spins in infinite loop with the old code. With the new code, test works fine 🚀

@emrysal emrysal merged commit efc7be0 into main Oct 25, 2023
@emrysal emrysal deleted the bugfix/get-available-dates-negative-utc-offsets branch October 25, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working core area: core, team members only Urgent Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants