Sunan an-Nasa'i, Book 21, Hadith 237 (In-Book)

It was narrated from Rashid bin Sa'd, that a man among the Companions of the Prophet said: "O Messenger of Allah, why will the believers be tested in their graves except the martyr?" He said: "The flashing of the swords above his head is trial enough."

أَخْبَرَنَا إِبْرَاهِيمُ بْنُ الْحَسَنِ، قَالَ حَدَّثَنَا حَجَّاجٌ، عَنْ لَيْثِ بْنِ سَعْدٍ، عَنْ مُعَاوِيَةَ بْنِ صَالِحٍ، أَنَّ صَفْوَانَ بْنَ عَمْرٍو، حَدَّثَهُ عَنْ رَاشِدِ بْنِ سَعْدٍ، عَنْ رَجُلٍ، مِنْ أَصْحَابِ النَّبِيِّ صلى الله عليه وسلم أَنَّ رَجُلاً قَالَ يَا رَسُولَ اللَّهِ مَا بَالُ الْمُؤْمِنِينَ يُفْتَنُونَ فِي قُبُورِهِمْ إِلاَّ الشَّهِيدَ قَالَ ‏ "‏ كَفَى بِبَارِقَةِ السُّيُوفِ عَلَى رَأْسِهِ فِتْنَةً ‏" ‏ ‏.‏

sunnah.com