Skip to content

Commit

Permalink
Avoid concurrent modification in cluster scaler tests (#4600)
Browse files Browse the repository at this point in the history
This will fix #4599 by making the mock leader thread safe.
  • Loading branch information
adamnovak authored Sep 29, 2023
1 parent 7650597 commit f1055a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/toil/test/provisioners/clusterScalerTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,9 @@ def getNumberOfJobsIssued(self, preemptible=None):
return self.jobQueue.qsize()

def getJobs(self):
return self.jobBatchSystemIDToIssuedJob.values()
# jobBatchSystemIDToIssuedJob may be modified while we are working.
# So copy it.
return dict(self.jobBatchSystemIDToIssuedJob).values()

# AbstractScalableBatchSystem functionality
def getNodes(self, preemptible: Optional[bool] = False, timeout: int = 600):
Expand Down

0 comments on commit f1055a3

Please sign in to comment.