[JENKINS-47681] Don't count slaves we just provisioned multiple times
When provisioning several on demand slaves, provisionOndemand() can return the same slave multiple times while it is launching. Keep a list of already provisioned slaves, and exclude them from the available pool when asking for more slaves.
I would like to apply this change over PR252 and test it as this PR will probably fix a similar issue we are facing atm.
I tried to cherry-pick this commit but there are loads of conflicts, which I don't pretty understand which ones to keep.
@OliverPereira I'm using this internally, but have not had time to track down the test failures that blew up my pull request. I plan to have someone address this in the next few weeks, and can then get this integrated.