 class SentryStacktraceBuilderTests: XCTestCase {
     
     private class Fixture {
-        func getSut() -> SentryStacktraceBuilder {
-            SentryStacktraceBuilder(crashStackEntryMapper: SentryCrashStackEntryMapper(inAppLogic: SentryInAppLogic(inAppIncludes: [], inAppExcludes: [])))
+        let queue = DispatchQueue(label: "SentryStacktraceBuilderTests")
+        
+        var sut: SentryStacktraceBuilder {
+            return SentryStacktraceBuilder(crashStackEntryMapper: SentryCrashStackEntryMapper(inAppLogic: SentryInAppLogic(inAppIncludes: [], inAppExcludes: [])))
         }
+    }
+    
+    private var fixture: Fixture!
+    
+    override func setUp() {
+        super.setUp()
+        fixture = Fixture()
     }
     
     override func tearDown() {
         super.tearDown()
-        SentrySDK.close()
+        clearTestState()
     }
     
-    private let fixture = Fixture()
-    
     func testEnoughFrames() {
-        let actual = fixture.getSut().buildStacktraceForCurrentThread()
+        let actual = fixture.sut.buildStacktraceForCurrentThread()
         
         // The stacktrace has usually more than 40 frames. Feel free to change the number if the tests are failing
-        XCTAssertTrue(30 < actual.frames.count, "Not enough stacktrace frames.")
+        XCTAssertTrue(30 < actual.frames.count, "Not enough stacktrace frames. It should be more than 30, but was \(actual.frames.count)")
     }
     
     func testFramesAreFilled() {
-        let actual = fixture.getSut().buildStacktraceForCurrentThread()
+        let actual = fixture.sut.buildStacktraceForCurrentThread()
         
         // We don't know the actual values of the frames so we can't write
         // deterministic tests here. Therefore we just make sure they are

    }
    
    func testFramesOrder() {
        let actual = fixture.getSut().buildStacktraceForCurrentThread()
        
        // Make sure the first 4 frames contain main
        let frames = actual.frames[...3]

    }
    
    func testFramesDontContainBuilderFunction() {
        let actual = fixture.sut.buildStacktraceForCurrentThread()
        
        let result = actual.frames.contains { frame in
            return frame.function?.contains("buildStacktraceForCurrentThread") ?? false
