A local anesthetic
is often enough to make the discomfort tolerable.
However, there are people who fear closed spaces so take a tranquilizer and doze off during the procedure. The same with people who are afraid of needles. If the test is necessary, the doctor should make sure that you are able to tolerate it. If they aren't sympathetic, get another doctor.