Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Fix some flaky tests #666

Merged
merged 1 commit into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Source/santad/SNTExecutionControllerTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ - (santa_vnode_id_t)getVnodeId {
return (santa_vnode_id_t){.fsid = 1234, .fileid = 5678};
}

- (void)tearDown {
[self.mockFileInfo stopMocking];
[self.mockCodesignChecker stopMocking];
[self.mockDriverManager stopMocking];
[self.mockRuleDatabase stopMocking];
[self.mockEventDatabase stopMocking];

[super tearDown];
}

- (void)testBinaryAllowRule {
OCMStub([self.mockFileInfo isMachO]).andReturn(YES);
OCMStub([self.mockFileInfo SHA256]).andReturn(@"a");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ - (instancetype)init {
self = [super init];
if (self) {
_dateFormatter = [[NSDateFormatter alloc] init];
[_dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"];
_dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
_dateFormatter.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
}
return self;
}
Expand Down
6 changes: 0 additions & 6 deletions Source/santametricservice/Writers/SNTMetricHTTPWriterTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ - (void)setUp {
.andReturn(self.mockSessionDataTask);
}

- (void)tearDown {
[self.mockSessionDataTask stopMocking];
[self.mockSession stopMocking];
[self.mockMOLAuthenticatingURLSession stopMocking];
}

/// enqueues a mock HTTP response for testing.
- (void)createMockResponseWithURL:(NSURL *)url
withCode:(NSInteger)code
Expand Down