The string_escape encoding used here was removed in Python 3 which makes the test crash during tearDown:
File "/Users/teemperor/3llvm/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/case.py", line 386, in run
self.tearDown()
File "/Users/teemperor/3llvm/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py", line 124, in tearDown
self._pump_queues.verify_queues_empty()
File "/Users/teemperor/3llvm/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py", line 55, in verify_queues_empty
_dump_queue(self.packet_queue())
File "/Users/teemperor/3llvm/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py", line 28, in _dump_queue
print(codecs.encode(the_queue.get(True), "string_escape"))
LookupError: unknown encoding: string_escapeJust replace it with repr which should work in both Python versions.