Prevent daylight-savings-related failures in on-call management specs
What does this MR do?
Daylight savings is upon us. On-call shifts are prime for daylight-savings-related errors. We just had one recently which broke master. !55961 (merged)
We're about to have a similar error tomorrow and some more on March 26. This MR prevents that error from breaking master by switching the on-call schedules used to UTC, where they won't have any DST to worry about.
March 13 errors (day before DST change in New York):
ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb:219
March 26 errors (2 days before DST change in Berlin):
ee/spec/graphql/resolvers/incident_management/oncall_shifts_resolver_spec.rb:24
ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb:84
ee/spec/services/incident_management/oncall_shifts/read_service_spec.rb[1:1:8:1:1]
ee/spec/services/incident_management/oncall_shifts/read_service_spec.rb[1:1:8:3:1]
The fix in this MR isn't perfect, and I'll follow-up with something more robust per !55961 (comment 524015289) next week, but we're now in crunch time as this error will break master tomorrow.
Testing
Recording how I checked this for posterity:
- Update local date/time on the machine (to avoid duplicate
travel_to
in the specs) - Run both BE & FE tests covering on-call schedules.
- Run again for each of March 12-15, March 26-29, April 2-5 during the 1700 UTC hour
- Run again for each of March 13, March 27, April 3 during the 0300 UTC hour
yarn install && yarn jest ./ee/spec/frontend/oncall_schedule
spring stop && bundle exec spring rspec ./ee/spec/models/incident_management ./ee/spec/policies/incident_management ./ee/spec/requests/api/graphql/mutations/incident_management ./ee/spec/finders/incident_management ./ee/spec/graphql/types/incident_management ./ee/spec/graphql/mutations/incident_management ./ee/spec/graphql/resolvers/incident_management ./ee/spec/lib/incident_management/oncall_shift_generator_spec.rb ./ee/spec/workers/incident_management ./ee/spec/controllers/projects/incident_management/oncall_schedules_controller_spec.rb ./ee/spec/services/incident_management
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. - [-] I have not included a changelog entry because it's only tests.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team