|
17 | 17 | #import "Service/Tests/FunctionalTests/EDOServiceUIBaseTest.h" |
18 | 18 |
|
19 | 19 | #include <objc/runtime.h> |
| 20 | +#include <pthread.h> |
20 | 21 |
|
21 | 22 | #import <CoreImage/CoreImage.h> |
22 | 23 |
|
@@ -223,7 +224,10 @@ - (void)testMultiplexInvocationStressfully { |
223 | 224 | - (void)testTemporaryServiceHandlesRecursiveCall { |
224 | 225 | [self launchApplicationWithPort:EDOTEST_APP_SERVICE_PORT initValue:5]; |
225 | 226 | EDOTestDummy *remoteDummy = [EDOClientService rootObjectWithPort:EDOTEST_APP_SERVICE_PORT]; |
226 | | - dispatch_queue_t testQueue = dispatch_queue_create("com.google.edotest", DISPATCH_QUEUE_SERIAL); |
| 227 | + // Align QoS with eDO internal threads to avoid priority inversion. |
| 228 | + dispatch_queue_attr_t attr = |
| 229 | + dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0); |
| 230 | + dispatch_queue_t testQueue = dispatch_queue_create("com.google.edotest", attr); |
227 | 231 |
|
228 | 232 | XCTestExpectation *expectation = [self expectationWithDescription:@"recursive call completes."]; |
229 | 233 | __block NSUInteger recursiveLayer = 5; |
@@ -273,8 +277,10 @@ - (void)testDispatchAsyncEarlyReturn { |
273 | 277 |
|
274 | 278 | - (void)testDispatchAsyncManyTimes { |
275 | 279 | [self launchApplicationWithPort:EDOTEST_APP_SERVICE_PORT initValue:8]; |
| 280 | + dispatch_queue_attr_t attr = |
| 281 | + dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0); |
276 | 282 | NS_VALID_UNTIL_END_OF_SCOPE dispatch_queue_t backgroundQueue = |
277 | | - dispatch_queue_create("com.google.edo.uitest", DISPATCH_QUEUE_SERIAL); |
| 283 | + dispatch_queue_create("com.google.edo.uitest", attr); |
278 | 284 | EDOTestDummyInTest *rootDummy = [[EDOTestDummyInTest alloc] initWithValue:9]; |
279 | 285 | EDOHostService *service = [EDOHostService serviceWithPort:2234 |
280 | 286 | rootObject:rootDummy |
|
0 commit comments