I'd take the gamble on the test, unless you are 100% sure you are going to fail. Honestly, it depends on the company as well. If they're larger, then it will probably result in a termination or they'll pass on you. A smaller company, on the other hand, may be flexible if they really want you.
A small company who I worked for had an intern fail who was really good at materials analysis and they basically said," Don't smoke weed for 3 weeks because we are testing you again!".
That is, of course, very rare for a company.