But they passed their training. How do you find the person who is going to panic?
The training is supposed to include the elements of scenarios where it's possible to make a reasonable assessment of the propensity to panic. Of course, in training - especially in a simulator - it's almost impossible to inject any real jeopardy into any scenario. But skilled instructors and assessors can spot the warning signs of propensity to panic even in reduced-stress scenarios.
And anyhow, very few pilots who get full certification do manage to get that far with a propensity to panic or get disproportionately stressed in an emergency situation. In the vast majority of cases where pilots (those who survive accidents) subsequently claim not to have heard/seen auditory/visual warnings on the flight deck, they are simply not telling the truth. The truth is that they did hear/see the warnings, but for a variety of reasons - ego being perhaps the biggest one - they chose to ignore or minimise them.
If there's one thing that can be taken away from accidents like AF447, I think it's that still more research is needed into human factors in aircrew. I'd say that commercial pilots have a higher proportionate streak of stubbornness and egotism in them than the public at large, and that in some cases this can translate into real - and fatal - problems in emergency scenarios. I believe that commercial passenger aircraft flight crews should undergo more rigorous psychiatric assessments, and they should be pushed to psychological limits in training to get the best indication to their "grace under pressure".
I'm reminded of the legendary SAS training course techniques, where, in one exercise, they would tie applicants blindfolded to a railway line (under the guise of a "terrorist/hostage" scenario or similar), then have a locomotive come down the line. The instructors would then feign panic at the situation going wrong ("Oh my god! There's a train coming! Untie the guy now! Abort the training exercise!" sort of thing), and they would observe the reactions of the applicant tied to the tracks. What they wanted was for the applicant to take measured, rational steps to free himself from his bindings, and to calmly call for assistance. What they didn't want to see was the applicant screaming in blind panic and pulling uselessly at the bindings. Of course, unbeknown to the applicant, he had been tied to the track just beyond a points junction, and the locomotive would pass onto a parallel track at the last moment. Many an applicant was weeded out through this exercise.....