fix creating a lot of unneeded machines in docker machine autoscale
I got bug with autoscaling on amazon ec2:
When gitlab-runner tries to create one machine it creates a lot of machines (e.g. 15)
That was because (machineProvider).Acquire
calls multiple times in short period of time and machines created by previous calls not immediately shown in (machineProvider).loadMachines
result and some of next calls not properly count number of creating machines and try to create another one
This MR is minimal fix that was works for me, also adds test case
Does this MR meet the acceptance criteria?
-
Added tests for this feature/bug -
In case of conflicts with master
- branch was rebased
Relates issues
I thinks #4424 (closed) is related
Offtop - when i disable MR feature on my fork i cannot create MR for this repository (looks strange)
Edited by 🤖 GitLab Bot 🤖