Skip to content

Commit

Permalink
More logging to debug failed listing due to invalid format
Browse files Browse the repository at this point in the history
Summary: Many tests are failing due to the error "Failed to list tests". Logs include the error "The data couldn’t be read because it isn’t in the correct format." Current logs indicate that reading the data may be truncated- length of the data seems to be either 0 or smaller than on successful runs. This diff logs the contents of the temporary file that should contain test data if it is not read successfully.

Differential Revision: D65140844

fbshipit-source-id: 23a56b4ec869aa39b46f8cc10ddc39d0f9755c95
  • Loading branch information
Abrar Ahmed authored and facebook-github-bot committed Oct 29, 2024
1 parent be053d3 commit 2123f13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion XCTestBootstrap/Strategies/FBListTestStrategy.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ - (instancetype)initWithTarget:(id<FBiOSTarget, FBProcessSpawnCommands, FBXCTest
NSError *error = nil;
NSArray<NSDictionary<NSString *, NSString *> *> *tests = [NSJSONSerialization JSONObjectWithData:shimBuffer.data options:0 error:&error];
if (!tests) {
NSLog(@"Shimulator buffer data (should contain test information): %@", shimBuffer.data);
NSLog(@"Shimulator buffer data (should contain test information): %@", [[NSString alloc] initWithData:shimBuffer.data encoding:NSUTF8StringEncoding]);
return [FBFuture futureWithError:error];
}
NSMutableArray<NSString *> *testNames = [NSMutableArray array];
Expand Down

0 comments on commit 2123f13

Please sign in to comment.