Skip to content

Commit 8f77f8c

Browse files
committed
[Tests] Skip the newly added test if TSan is enabled
TSan seems to trigger a false positive with this test.
1 parent 04ad3d1 commit 8f77f8c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Tests/IndexStoreDBTests/IndexStoreDBTests.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ import ISDBTibs
1515
import XCTest
1616
import Foundation
1717

18+
let isTSanEnabled: Bool = {
19+
if let value = ProcessInfo.processInfo.environment["INDEXSTOREDB_ENABLED_THREAD_SANITIZER"] {
20+
return value == "1" || value == "YES"
21+
}
22+
return false
23+
}()
24+
1825
func checkThrows(_ expected: IndexStoreDBError, file: StaticString = #file, line: UInt = #line, _ body: () throws -> ()) {
1926
do {
2027
try body()
@@ -73,6 +80,9 @@ final class IndexStoreDBTests: XCTestCase {
7380
}
7481

7582
func testSymlinkedDBPaths() throws {
83+
// FIXME: This test seems to trigger a false-positive in TSan.
84+
try XCTSkipIf(isTSanEnabled, "skipping because TSan is enabled")
85+
7686
let toolchain = TibsToolchain.testDefault
7787
let libIndexStore = try! IndexStoreLibrary(dylibPath: toolchain.libIndexStore.path)
7888

Utilities/build-script-helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def handle_invocation(swift_exec, args):
6262
if args.sanitize and 'undefined' in args.sanitize:
6363
supp = os.path.join(args.package_path, 'Utilities', 'ubsan_supressions.supp')
6464
env['UBSAN_OPTIONS'] = 'halt_on_error=true,suppressions=%s' % supp
65+
if args.sanitize and 'thread' in args.sanitize:
66+
env['INDEXSTOREDB_ENABLED_THREAD_SANITIZER'] = '1'
6567

6668
# Workaround for incremental build bug in swiftpm.
6769
print('Cleaning ' + args.build_path)

0 commit comments

Comments
 (0)