Skip to content

Commit 12c021a

Browse files
committed
[5.0] Improve StringMemoryTest.swift
The test fails on some bots as written before. rdar://48845923
1 parent 1961044 commit 12c021a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

validation-test/stdlib/StringMemoryTest.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func lowercase(_ str: String) -> String {
4040

4141
@inline(never)
4242
func runTest() {
43-
for _ in 0 ..< 10_0000 {
43+
for _ in 0 ..< 15_0000 {
4444
if lookup("\u{1F1E7}\u{1F1E7}", dict) {
4545
print("Found?!")
4646
}
@@ -63,6 +63,7 @@ runTest()
6363
let firstRun = getMemoryUsage () - baseUsage
6464
runTest()
6565
runTest()
66+
runTest()
6667
let secondRun = getMemoryUsage () - baseUsage
6768

6869
// CHECK-NOT: Found?!
@@ -73,9 +74,8 @@ print("Not found")
7374
// CHECK: success
7475
// CHECK-NOT: failure
7576

76-
// We should not need 50MB for this.
77-
if firstRun * 2 < secondRun {
78-
print("failure - should not linearly increase")
77+
if firstRun * 3 < secondRun && firstRun > 10_000 {
78+
print("failure - should not linearly increase firstRun: \(firstRun) secondRun: \(secondRun)")
7979
} else {
80-
print("success")
80+
print("success firstRun: \(firstRun) secondRun: \(secondRun)")
8181
}

0 commit comments

Comments
 (0)