From 2123f13e4156f3b0cd998e0f07ea9e1f4a7d497b Mon Sep 17 00:00:00 2001 From: Abrar Ahmed Date: Tue, 29 Oct 2024 14:09:08 -0700 Subject: [PATCH] More logging to debug failed listing due to invalid format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- XCTestBootstrap/Strategies/FBListTestStrategy.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XCTestBootstrap/Strategies/FBListTestStrategy.m b/XCTestBootstrap/Strategies/FBListTestStrategy.m index 88fa34c72..ab171cb60 100644 --- a/XCTestBootstrap/Strategies/FBListTestStrategy.m +++ b/XCTestBootstrap/Strategies/FBListTestStrategy.m @@ -171,7 +171,7 @@ - (instancetype)initWithTarget:(id *> *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 *testNames = [NSMutableArray array];