From 9710c4ee184608075e400b4fe29d89f47fed3aa1 Mon Sep 17 00:00:00 2001 From: eDO Team Date: Fri, 6 Mar 2026 11:45:50 -0800 Subject: [PATCH] Test fixes PiperOrigin-RevId: 879741144 --- Service/Tests/FunctionalTests/EDOServiceUIBlockTest.m | 3 +++ Service/Tests/FunctionalTests/EDOServiceUITest.m | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Service/Tests/FunctionalTests/EDOServiceUIBlockTest.m b/Service/Tests/FunctionalTests/EDOServiceUIBlockTest.m index 5afd35f..de40fab 100644 --- a/Service/Tests/FunctionalTests/EDOServiceUIBlockTest.m +++ b/Service/Tests/FunctionalTests/EDOServiceUIBlockTest.m @@ -16,6 +16,8 @@ #import "Service/Tests/FunctionalTests/EDOServiceUIBaseTest.h" +#include + #import "Service/Sources/EDOClientService.h" #import "Service/Sources/EDOHostService.h" #import "Service/Sources/NSObject+EDOValueObject.h" @@ -154,6 +156,7 @@ - (void)testBlockResolveToLocalAddress { // Sending block to remote process through background eDO host. dispatch_sync(backgroundQueue, ^{ + pthread_set_qos_class_self_np(QOS_CLASS_DEFAULT, 0); remoteDummy.block = localBlock; }); diff --git a/Service/Tests/FunctionalTests/EDOServiceUITest.m b/Service/Tests/FunctionalTests/EDOServiceUITest.m index 217affe..afafab4 100644 --- a/Service/Tests/FunctionalTests/EDOServiceUITest.m +++ b/Service/Tests/FunctionalTests/EDOServiceUITest.m @@ -17,6 +17,7 @@ #import "Service/Tests/FunctionalTests/EDOServiceUIBaseTest.h" #include +#include #import @@ -223,7 +224,10 @@ - (void)testMultiplexInvocationStressfully { - (void)testTemporaryServiceHandlesRecursiveCall { [self launchApplicationWithPort:EDOTEST_APP_SERVICE_PORT initValue:5]; EDOTestDummy *remoteDummy = [EDOClientService rootObjectWithPort:EDOTEST_APP_SERVICE_PORT]; - dispatch_queue_t testQueue = dispatch_queue_create("com.google.edotest", DISPATCH_QUEUE_SERIAL); + // Align QoS with eDO internal threads to avoid priority inversion. + dispatch_queue_attr_t attr = + dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0); + dispatch_queue_t testQueue = dispatch_queue_create("com.google.edotest", attr); XCTestExpectation *expectation = [self expectationWithDescription:@"recursive call completes."]; __block NSUInteger recursiveLayer = 5; @@ -273,8 +277,10 @@ - (void)testDispatchAsyncEarlyReturn { - (void)testDispatchAsyncManyTimes { [self launchApplicationWithPort:EDOTEST_APP_SERVICE_PORT initValue:8]; + dispatch_queue_attr_t attr = + dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0); NS_VALID_UNTIL_END_OF_SCOPE dispatch_queue_t backgroundQueue = - dispatch_queue_create("com.google.edo.uitest", DISPATCH_QUEUE_SERIAL); + dispatch_queue_create("com.google.edo.uitest", attr); EDOTestDummyInTest *rootDummy = [[EDOTestDummyInTest alloc] initWithValue:9]; EDOHostService *service = [EDOHostService serviceWithPort:2234 rootObject:rootDummy