I have a powerful PC which is able to start my mongod fast. Maybe try 15 sec and see if that works?
If it does work, then you can lower the sleep time until it doesn’t and add an extra “security” second to avoid the “coin flip”.
If that still doesn’t work… Then I guess there is something else…
Does that work if you start a mongod without the --replSet option?
I guess you need some features of the RS but this would be a first step.
Cheers,
Max.