[lldb] Don't ask for QOS_CLASS_UNSPECIFIED queue in TestQueues

TestQueues is curiously failing for me as my queue for QOS_CLASS_UNSPECIFIED
is named "Utility" and not "User Initiated" or "Default". While debugging, this
I noticed that this test isn't actually using this API right from what I understand. The API documentation
for `dispatch_get_global_queue` specifies for the parameter: "You may specify the value
QOS_CLASS_USER_INTERACTIVE, QOS_CLASS_USER_INITIATED, QOS_CLASS_UTILITY, or QOS_CLASS_BACKGROUND."

QOS_CLASS_UNSPECIFIED isn't listed as one of the supported values. swift-corelibs-libdispatch
even checks for this value and returns a DISPATCH_BAD_INPUT. The
libdispatch shipped on macOS seems to also check for QOS_CLASS_UNSPECIFIED and seems to
instead cause a "client crash", but somehow this doesn't trigger in this test and instead we just
get whatever queue

This patch just removes that part of the test as it appears the code is just incorrect.

Reviewed By: jasonmolenda

Differential Revision: https://reviews.llvm.org/D86211
This commit is contained in:
Raphael Isemann 2020-08-25 19:53:48 +02:00
parent ae90df8e5a
commit 7de7fe5d0e
2 changed files with 1 additions and 23 deletions

View File

@ -192,7 +192,6 @@ class TestQueues(TestBase):
user_initiated_thread = lldb.SBThread()
user_interactive_thread = lldb.SBThread()
utility_thread = lldb.SBThread()
unspecified_thread = lldb.SBThread()
background_thread = lldb.SBThread()
for th in process.threads:
if th.GetName() == "user initiated QoS":
@ -201,8 +200,6 @@ class TestQueues(TestBase):
user_interactive_thread = th
if th.GetName() == "utility QoS":
utility_thread = th
if th.GetName() == "unspecified QoS":
unspecified_thread = th
if th.GetName() == "background QoS":
background_thread = th
@ -213,9 +210,6 @@ class TestQueues(TestBase):
user_interactive_thread.IsValid(),
"Found user interactive QoS thread")
self.assertTrue(utility_thread.IsValid(), "Found utility QoS thread")
self.assertTrue(
unspecified_thread.IsValid(),
"Found unspecified QoS thread")
self.assertTrue(
background_thread.IsValid(),
"Found background QoS thread")
@ -248,16 +242,6 @@ class TestQueues(TestBase):
stream.GetData(), "Utility",
"utility QoS thread name is valid")
stream.Clear()
self.assertTrue(
unspecified_thread.GetInfoItemByPathAsString(
"requested_qos.printable_name",
stream),
"Get QoS printable string for unspecified QoS thread")
qosName = stream.GetData()
self.assertTrue(
qosName == "User Initiated" or qosName == "Default",
"unspecified QoS thread name is valid: " + str(qosName))
stream.Clear()
self.assertTrue(
background_thread.GetInfoItemByPathAsString(
"requested_qos.printable_name",

View File

@ -136,15 +136,9 @@ int main (int argc, const char **argv)
while (1)
sleep (10);
});
dispatch_async (dispatch_get_global_queue(QOS_CLASS_UNSPECIFIED, 0), ^{
pthread_setname_np ("unspecified QoS");
atomic_fetch_add(&thread_count, 1);
while (1)
sleep (10);
});
// Unfortunately there is no pthread_barrier on darwin.
while ((atomic_load(&thread_count) < 13) || (finished_enqueueing_work == 0))
while ((atomic_load(&thread_count) < 12) || (finished_enqueueing_work == 0))
sleep (1);
stopper ();