If your Sensei gives you permission to test, then you have already passed the test. My Sensei tells us that the test is just a demonstration for the other people to see what you can do. So relax and enjoy the demo!
This is only true if you're sensei is the examiner. In the case of my shodan exam two years ago, the examiners were a panel of 4 shihans. I passed, but a third of those testing failed (none from my dojo). Last year a quarter failed. Their instructors all presumably told them they were ready. It was rather painfully obvious that some of them weren't.