Season 5 Episode 13 - Proving Ground
The SGC is running a group of cadets through training, and O'Neill isn't particularly satisfied with the group. When they fail two training exercises, Jack is ready to drop them out of the SGC program until he gets word of an alien incursion and is forced to take the cadets on as he invades SGC headquarters. It soon becomes clear (to the audience) the "invasion" is another training exercise. The cadets eventually figure it out but one of them, Haley, doesn't find out and opens the Stargate after taking the controls off-line. Haley is knocked out and radiation floods the chamber as the Gou'ald launch an attack...except that's a test too when the team leader, Elliot, goes back to rescue her.