Commit cbee42a
authored
[Collections] PackageCollectionsTests.testUpdateAuthTokens sometimes causes signal 11 (#3534)
Motivation:
rdar://78939220
`SQLitePackageCollectionsStorage.populateTargetTrie` is always called in the initializer and to be completed by a background thread. Looks like the crash could be caused by `populateTargetTrie` being run while `SQLitePackageCollectionsStorage` gets destroyed as part of `PackageCollections` deallocation.
Modifications:
Add option in `SQLitePackageCollectionsStorage.Configuration` to skip calling `populateTargetTrie` in tests to avoid the race between db destruction and `populateTargetTrie`. Not all tests need storage or make use of `populateTargetTrie`, and it's caused many crashes in CI already. We have added traps for db connection state but that doesn't seem to be enough.
Another approach is probably to use `withExtendedLifetime` in `testUpdateAuthTokens`, but I think it is better/easier to have the config option.1 parent 62fef21 commit cbee42a
File tree
3 files changed
+15
-7
lines changed- Sources/PackageCollections/Storage
- Tests/PackageCollectionsTests
3 files changed
+15
-7
lines changedLines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
1018 | 1020 | | |
1019 | 1021 | | |
1020 | 1022 | | |
| 1023 | + | |
1021 | 1024 | | |
1022 | 1025 | | |
1023 | 1026 | | |
1024 | | - | |
1025 | | - | |
| 1027 | + | |
1026 | 1028 | | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1027 | 1032 | | |
1028 | 1033 | | |
1029 | 1034 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
0 commit comments