I'm struggling with the following problem:

An electronic circuit has $X$ components. The circuit works only if all its components work. Suppose $Y$ components are defective. A component is randomly selected and tested; if defective, then it is replace by a component that works, next the circuit is checked again. If the circuit still not working this process is repeated again 
All circuit components are equally likely to be selected even if it has been previously tested. shows that the expected number of tests until the circuit work (for large $X$ and $Y$) is : $X(\log(Y)+\gamma)$

$\gamma $:= Euler's constant

Any hints please.