-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: Properly teardown frames tracker (#3545)
The teardown of the SentryFramesTracker didn't work properly in tests. The clearTestState method continuously initialized a new frames tracker cause it accessed the property dependency container. This is fixed now by calling SentryFramesTracker.stop directly in SentryDependencyContainer.reset which is also called in clearTestState. Furthermore, the SentryFramesTracker.stop now resets all frames and removes all observers.
- Loading branch information
1 parent
253f628
commit 1734d1b
Showing
6 changed files
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
Tests/SentryTests/Helper/SentryDependencyContainerTests.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Nimble | ||
import XCTest | ||
|
||
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) | ||
final class SentryDependencyContainerTests: XCTestCase { | ||
|
||
func testReset_CallsFramesTrackerStop() throws { | ||
let framesTracker = SentryDependencyContainer.sharedInstance().framesTracker | ||
framesTracker.start() | ||
SentryDependencyContainer.reset() | ||
|
||
expect(framesTracker.isRunning) == false | ||
} | ||
} | ||
#endif |
This file contains 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