Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion solrorbit/workload/workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ def union(self, other):
return self
else:
return DocumentCorpus(name=self.name,
documents=list(set(self.documents).union(other.documents)),
# sort by repr so the result is deterministic regardless of hash randomization
documents=sorted(set(self.documents).union(other.documents), key=repr),
streaming_ingestion=self.streaming_ingestion,
meta_data=dict(self.meta_data))

Expand Down
5 changes: 3 additions & 2 deletions tests/worker_coordinator/worker_coordinator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ async def test_execute_request_success(self):
self.executor._prepare_context_manager = mock.AsyncMock(return_value=context_manager)
self.executor.runner = mock.Mock()

with mock.patch('solrorbit.worker_coordinator.worker_coordinator.execute_single'):
with mock.patch('solrorbit.worker_coordinator.worker_coordinator.execute_single', new=mock.Mock()):
with mock.patch('asyncio.wait_for') as wait_for_mock:
wait_for_mock.return_value = (100, "docs", {"success": True})

Expand Down Expand Up @@ -2010,7 +2010,8 @@ async def test_execute_request_with_throttling(self):
self.executor._prepare_context_manager = mock.AsyncMock(return_value=context_manager)
self.executor.runner = mock.Mock()

with mock.patch('time.perf_counter', side_effect=[10.0, 10.5, 13.0]):
with mock.patch('solrorbit.worker_coordinator.worker_coordinator.execute_single', new=mock.Mock()), \
mock.patch('time.perf_counter', side_effect=[10.0, 10.5, 13.0]):
with mock.patch('asyncio.sleep') as sleep_mock:
with mock.patch('asyncio.wait_for') as wait_for_mock:
wait_for_mock.return_value = (50, "docs", {"success": True})
Expand Down