No problem if you fail your test.
What happens if I fail my non-commercial license road test?
Your learner permit remains valid until the expiration date.
What if my learner permit expires before my next road test?