Skip to content

Commit 16787b8

Browse files
committed
There is a chance that old test attributes are still present
1 parent 51f2bd4 commit 16787b8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Tests/Unit-Tests/NewRelicAgentTests/Analytics-Tests/NRMASAMTest.mm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ - (void)setUp {
2828

2929
manager = [self samTest];
3030
[manager removeAllSessionAttributes];
31+
32+
NSFileManager *fileManager = [NSFileManager defaultManager];
33+
if([fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file]]) {
34+
[fileManager removeItemAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file] error:nil];
35+
}
36+
if([fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file_private]]) {
37+
[fileManager removeItemAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file_private] error:nil];
38+
}
3139
}
3240

3341
- (NRMASAM*) samTest {
@@ -294,14 +302,6 @@ - (void)waitForAttributesToPersist:(NSArray<NSString *> *)expectedAttributes tim
294302

295303
- (void)testPersistedSessionAnalytics {
296304

297-
NSFileManager *fileManager = [NSFileManager defaultManager];
298-
if([fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file]]) {
299-
[fileManager removeItemAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file] error:nil];
300-
}
301-
if([fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file_private]]) {
302-
[fileManager removeItemAtPath:[NSString stringWithFormat:@"%@/%@",[NewRelicInternalUtils getStorePath],kNRMA_Attrib_file_private] error:nil];
303-
}
304-
305305
NSString *attribute = @"blarg";
306306
NSString *attribute2 = @"blarg2";
307307
NSString *attribute3 = @"privateBlarg3";

0 commit comments

Comments
 (0)