I've always lived in fear that I'll have to pass gas while having an exam. Luckily, it's never happened, but I am young yet and have many years of exams ahead of me... :)
What would you do/have you done? I mean, you can try to hold it, but you... can't always do so. And obviously you can't just do it without warning. So what do you say? "Excuse me, doctor? sorry, but you might want to back up a few feet for a minute or two." I mean, I know, it's not really an embarrassing thing (and I'm sure in the heat of the moment I would come up with an appropriately-polite "I'm sorry, but I need to pass gas"), but still kind of awkward to have to interrupt an exam...