File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1- Make "steal" command atomic - make it unschedule either all requested tests or none.
1+ The internal `steal` command is now atomic - make it unschedule either all requested tests or none.
2+
3+ This is a prerequisite for group/scope support in the `worksteal` scheduler, so tests won't be broken up incorrectly.
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ class Marker(enum.Enum):
7272
7373
7474class TestQueue :
75- """A simple queue that can be inspected and modified while the lock is held."""
75+ """A simple queue that can be inspected and modified while the lock is held via the ``lock()`` method ."""
7676
7777 Item = Union [int , Literal [Marker .SHUTDOWN ]]
7878
Original file line number Diff line number Diff line change @@ -267,8 +267,10 @@ def test_func4(): pass
267267
268268 worker .sendcommand ("steal" , indices = [1 , 2 ])
269269 ev = worker .popevent ("unscheduled" )
270+ # Cannot steal index 1 because it is completed already, so do not steal any.
270271 assert ev .kwargs ["indices" ] == []
271272
273+ # Index 2 can be stolen, as it is still pending.
272274 worker .sendcommand ("steal" , indices = [2 ])
273275 ev = worker .popevent ("unscheduled" )
274276 assert ev .kwargs ["indices" ] == [2 ]
You can’t perform that action at this time.
0 commit comments