When a test fails due to timeout it's often not clear what is the root cause. See HDFS-3364 as an example.
We can print dump of all threads in this case, this may help finding causes.
TestFileAppend4.testRecoverFinalizedBlock occasionally times out
Print thread dump when a test times out