Skip to content

Commit

Permalink
Revert "test: shorten some tests (#2422)" (#2427)
Browse files Browse the repository at this point in the history
This reverts commit 189472a.
  • Loading branch information
philipphofmann authored Nov 22, 2022
1 parent 189472a commit f781ecb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class SentryPerformanceTrackerTests: XCTestCase {
let queue = DispatchQueue(label: "SentryPerformanceTrackerTests", attributes: [.concurrent, .initiallyInactive])
let group = DispatchGroup()

for _ in 0 ..< 50 {
for _ in 0 ..< 50_000 {
group.enter()
queue.async {
let childId = self.startSpan(tracker: sut)
Expand Down
12 changes: 5 additions & 7 deletions Tests/SentryTests/Performance/SentryTracerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,12 @@ class SentryTracerTests: XCTestCase {

let queue = DispatchQueue(label: "SentryTracerTests", attributes: [.concurrent, .initiallyInactive])
let group = DispatchGroup()

let children = 5
let grandchildren = 10
for _ in 0 ..< children {

for _ in 0 ..< 5_000 {
group.enter()
queue.async {
let grandChild = child.startChild(operation: self.fixture.transactionOperation)
for _ in 0 ..< grandchildren {
for _ in 0 ..< 9 {
let grandGrandChild = grandChild.startChild(operation: self.fixture.transactionOperation)
grandGrandChild.finish()
}
Expand All @@ -723,7 +721,7 @@ class SentryTracerTests: XCTestCase {
assertOneTransactionCaptured(sut)

let spans = getSerializedTransaction()["spans"]! as! [[String: Any]]
XCTAssertEqual(spans.count, children * (grandchildren + 1) + 1)
XCTAssertEqual(spans.count, 50_001)
}

// Although we only run this test above the below specified versions, we expect the
Expand All @@ -737,7 +735,7 @@ class SentryTracerTests: XCTestCase {
let queue = DispatchQueue(label: "", qos: .background, attributes: [.concurrent, .initiallyInactive] )
let group = DispatchGroup()

let transactions = 5
let transactions = 10_000
for _ in 0..<transactions {
group.enter()
queue.async {
Expand Down
4 changes: 2 additions & 2 deletions Tests/SentryTests/SentryScopeSwiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ class SentryScopeSwiftTests: XCTestCase {
group.enter()
queue.async {

// The number is kept small for the CI to not take too long.
// The number is kept small for the CI to not take to long.
// If you really want to test this increase to 100_000 or so.
for _ in 0...10 {
for _ in 0...1_000 {
// Simulate some real world modifications of the user
self.modifyScope(scope: scope)
}
Expand Down
1 change: 1 addition & 0 deletions Tests/SentryTests/TestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Foundation

class TestClient: Client {
let sentryFileManager: SentryFileManager
let queue = DispatchQueue(label: "TestClient", attributes: .concurrent)

override init?(options: Options) {
sentryFileManager = try! SentryFileManager(options: options, andCurrentDateProvider: TestCurrentDateProvider())
Expand Down

0 comments on commit f781ecb

Please sign in to comment.