But tests do not reflect the conditions of "real life", at least not in research. The problems I work on now often takes weeks of months to solve, and if I get tired I can get up from my desk and have a cup of coffee (and/or go to the lab and do something that does not require much brain activity).
Of course I have to meet deadlines, but those rarely involve any real problem solving since the only deadlines I have now involves finishing reports, presentations etc. Moreover, I tend to have most of my "eureka" moments when I am NOT sitting at my desk (usually when doing the dishes or something similar).
Hence, it is perfectly possible to have been bad at taking tests (as in "solve 5 problems in 4 hours") and still end up being a good researcher. This is one reason why I thing grades based on a combination of projects, hand-in assignments and written exams are more likely to reflect how much someone has learned from a course than a single exam alone.