Skip to content

Commit

Permalink
fix: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg committed Dec 1, 2023
1 parent b2b899d commit ecf5821
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run tests
run: swift test --sanitize=thread
test-sanitize:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: 'swift test --sanitize=thread 2>&1 | grep "ThreadSanitizer: data race" || exit 0; exit 1'
run: swift test --sanitize=thread
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,13 @@ Once that succeeds, you can do the actual release:
```sh
pod trunk push UnleashProxyClientSwift.podspec --allow-warnings
```

## Testing

In order to test this package you can run the swift test command. To test thread safety, run swift test with:

```
swift test --sanitize=thread
```

This will give you warnings in the console when you have any data races.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class UnleashIntegrationTests: XCTestCase {
// Run isEnabled many times to trigger a data race when the poller is updating the data cache
// This is to test that the poller is thread safe, and you can verify this by running the test with
// swift test --sanitize=thread
for _ in 1...25000 {
for _ in 1...15000 {
let result = unleashClient.isEnabled(name: "dataRaceTest")
XCTAssertFalse(result)
}
Expand Down

0 comments on commit ecf5821

Please sign in to comment.