Skip to content

Commit

Permalink
fix: Fixed flaky testTimezoneChangeNotificationBreadcrumb (#2335)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrenskers authored Nov 2, 2022
1 parent 4e037c4 commit bdfccaa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions Sentry.xcodeproj/xcshareddata/xcschemes/Sentry.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@
<Test
Identifier = "SentryStacktraceBuilderTests/testAsyncStacktraces_disabled()">
</Test>
<Test
Identifier = "SentrySystemEventBreadcrumbsTest/testTimezoneChangeNotificationBreadcrumb_disabled()">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
Expand Down
1 change: 1 addition & 0 deletions Sources/Sentry/include/SentrySystemEventBreadcrumbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SENTRY_NO_INIT

#if TARGET_OS_IOS
- (void)start:(UIDevice *)currentDevice;
- (void)timezoneEventTriggered;
#endif

- (void)stop;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,14 @@ class SentrySystemEventBreadcrumbsTest: XCTestCase {
}
}

func testTimezoneChangeNotificationBreadcrumb_disabled() {
func testTimezoneChangeNotificationBreadcrumb() {
let scope = Scope()
sut = fixture.getSut(scope: scope, currentDevice: nil)

fixture.currentDateProvider.timezoneOffsetValue = 7_200

NotificationCenter.default.post(Notification(name: NSNotification.Name.NSSystemTimeZoneDidChange))
sut.timezoneEventTriggered()

assertBreadcrumbAction(scope: scope, action: "TIMEZONE_CHANGE") { data in
XCTAssertEqual(data["previous_seconds_from_gmt"] as? Int, 0)
XCTAssertEqual(data["current_seconds_from_gmt"] as? Int, 7_200)
Expand Down

0 comments on commit bdfccaa

Please sign in to comment.