A man asked, "Messenger of Allah, why is it that the believers are tested in their graves except for the martyr?"He ﷺ replied, "The flashing of swords above his head was test enough for him."
ﷺ أن رجلا قال: يا رسول الله، ما بال المؤمنين يفتنون في قبورهم إلا الشهيد؟ قال: كفى ببارقة السيوف على رأسه فتنة.
Nasai (2053) narrated it from Ibrahim bin Hasan, who said, Hajjaj narrated to us, from Layth bin Saad, from Muawiya bin Salih, that Safwan bin Amr told him, from Rashid bin Saad, from a man among the companions of the Prophet ﷺ, and he mentioned it. Its isnad is sahih, and it is cited in the Funerals chapter.