@@ -139,6 +139,8 @@ - (void)testMigrationIfLegacyKeyPairsExist {
139
139
[self waitForExpectationsWithTimeout: 1 handler: nil ];
140
140
}
141
141
142
+ // Disabling test for now. We need to find a flake free way to insure the publicKeyRef is retained.
143
+ #ifdef DISABLED
142
144
- (void )testUpdateKeyRefWithTagRetainsAndReleasesKeyRef {
143
145
SecKeyRef publicKeyRef;
144
146
@@ -154,31 +156,16 @@ - (void)testUpdateKeyRefWithTagRetainsAndReleasesKeyRef {
154
156
155
157
publicKeyRef = keyPair.publicKey ;
156
158
157
- // Retain to keep publicKeyRef alive to verify its reatin count
158
- CFRetain (publicKeyRef);
159
-
160
- // 2 = 1 from keyPair + 1 from CFRetain()
161
- XCTAssertEqual (CFGetRetainCount (publicKeyRef), 2 );
162
-
163
- XCTestExpectation *completionExpectaion =
164
- [self expectationWithDescription: @" completionExpectaion" ];
159
+ XCTestExpectation *completionExpectation =
160
+ [self expectationWithDescription: @" completionExpectation" ];
165
161
[self .keyPairStore updateKeyRef: keyPair.publicKey
166
162
withTag: @" test"
167
163
handler: ^(NSError *error) {
168
- [completionExpectaion fulfill ];
164
+ [completionExpectation fulfill ];
169
165
}];
170
-
171
- // 3 = from keyPair + 1 from CFRetain() + 1 retained by `updateKeyRef`
172
- XCTAssertEqual (CFGetRetainCount (publicKeyRef), 3 );
173
166
}
174
-
175
- // 2 = 1 from CFRetain() + 1 retained by `updateKeyRef`
176
- XCTAssertEqual (CFGetRetainCount (publicKeyRef), 2 );
177
-
178
167
[self waitForExpectationsWithTimeout: 0.5 handler: NULL ];
179
-
180
- // No one else owns publicKeyRef except the test
181
- XCTAssertEqual (CFGetRetainCount (publicKeyRef), 1 );
182
168
}
169
+ #endif
183
170
184
171
@end
0 commit comments