Each program has their own rules about whether or not they require people to have passed Step 2 before they rank you. They do it for exactly this reason; they don't want to find out after you match that you are having trouble passing board/licensing exams.
As above, IMGs must pass the test, period.