take it asap, and you have to pass it if you are applying for ILR, as you need to send the cert with your app

if you cannot pass it in time ,then you need to apply for FLR before your visa expires