I already took the test May of this year even if I can only apply for ILR on june 2010 before my spouse visa would expire.
The Pass notification they'll give you once you passed the test has no restrictions / expiration on it as to when it is only good for. So, I pressumed taking test anytime is fine!
Good Luck!