Skip to content

Commit 5e625a2

Browse files
committed
Fix a bug in the work stealing implementation
1 parent eff80b8 commit 5e625a2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

testprocess/TestItemServer/src/TestItemServer.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,14 @@ end
662662

663663
function steal_testitems_request(endpoint::JSONRPC.JSONRPCEndpoint, params::TestItemServerProtocol.StealTestItemsRequestParams, state::TestProcessState)
664664
state.testrun_id == params.testRunId || error("Invalid test process state")
665-
state.is_batch_running == true || error("Invalid state")
666665

667-
for i in params.testItemIds
668-
push!(state.stolen_test_items, i)
666+
# If we are no longer running a batch, the steal message came to late, we
667+
# apparently finished all test item between the moment when the steal test items
668+
# were computed and this message was received. So we just ignore.
669+
if state.is_batch_running
670+
for i in params.testItemIds
671+
push!(state.stolen_test_items, i)
672+
end
669673
end
670674

671675
return nothing

0 commit comments

Comments
 (0)