File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -869,6 +869,21 @@ def test_loop_call_later_handle_when_after_fired(self):
869869 self .loop .run_until_complete (fut )
870870 self .assertEqual (handle .when (), when )
871871
872+ def test_thread_name_prefix_in_default_executor (self ):
873+ called = []
874+
875+ def cb ():
876+ called .append (threading .current_thread ().name )
877+
878+ async def runner ():
879+ await self .loop .run_in_executor (None , cb )
880+
881+ self .loop .run_until_complete (runner ())
882+
883+ self .assertEqual (len (called ), 1 )
884+ self .assertTrue (called [0 ] is not None )
885+ self .assertTrue (called [0 ].startswith ("uvloop" ))
886+
872887
873888class TestBaseAIO (_TestBase , AIOTestCase ):
874889 pass
Original file line number Diff line number Diff line change @@ -2741,7 +2741,7 @@ cdef class Loop:
27412741 # Only check when the default executor is being used
27422742 self ._check_default_executor()
27432743 if executor is None :
2744- executor = cc_ThreadPoolExecutor()
2744+ executor = cc_ThreadPoolExecutor(thread_name_prefix = ' uvloop ' )
27452745 self ._default_executor = executor
27462746
27472747 return aio_wrap_future(executor.submit(func, * args), loop = self )
You can’t perform that action at this time.
0 commit comments