A high school (look at here) exit exam is needed in the United States for students to be able to graduate.
If a student does not pass the test the first time, there are multiple opportunities to retake the test within a certain number of years depending on the educational laws of the state.