Skip to content

Commit 2123f13

Browse files
Abrar Ahmedfacebook-github-bot
Abrar Ahmed
authored andcommitted
More logging to debug failed listing due to invalid format
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
1 parent be053d3 commit 2123f13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

XCTestBootstrap/Strategies/FBListTestStrategy.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ - (instancetype)initWithTarget:(id<FBiOSTarget, FBProcessSpawnCommands, FBXCTest
171171
NSError *error = nil;
172172
NSArray<NSDictionary<NSString *, NSString *> *> *tests = [NSJSONSerialization JSONObjectWithData:shimBuffer.data options:0 error:&error];
173173
if (!tests) {
174-
NSLog(@"Shimulator buffer data (should contain test information): %@", shimBuffer.data);
174+
NSLog(@"Shimulator buffer data (should contain test information): %@", [[NSString alloc] initWithData:shimBuffer.data encoding:NSUTF8StringEncoding]);
175175
return [FBFuture futureWithError:error];
176176
}
177177
NSMutableArray<NSString *> *testNames = [NSMutableArray array];

0 commit comments

Comments
 (0)