Language:
كتاب الجهاد والسير
56  
Fighting for the Cause of Allah (Jihaad)
(11)
Chapter: The Statement of Allah Aza wa'jal: "Say: Do you wait for us except one of the two best things (martyrdom or victory)?..."
(11)
بَابُ قَوْلِ اللَّهِ تَعَالَى: {هَلْ تَرَبَّصُونَ بِنَا إِلاَّ إِحْدَى الْحُسْنَيَيْنِ} وَالْحَرْبُ سِجَالٌ
Sahih al-Bukhari 2804

Narrated `Abdullah bin `Abbas:

That Abu Sufyan told him that Heraclius said to him, "I asked you about the outcome of your battles with him (i.e. the Prophet (ﷺ) ) and you told me that you fought each other with alternate success. So the Apostles are tested in this way but the ultimate victory is always theirs.

حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، حَدَّثَنَا اللَّيْثُ، قَالَ حَدَّثَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ، أَنَّ عَبْدَ اللَّهِ بْنَ عَبَّاسٍ، أَخْبَرَهُ أَنَّ أَبَا سُفْيَانَ أَخْبَرَهُ أَنَّ هِرَقْلَ قَالَ لَهُ سَأَلْتُكَ كَيْفَ كَانَ قِتَالُكُمْ إِيَّاهُ فَزَعَمْتَ أَنَّ الْحَرْبَ سِجَالٌ وَدُوَلٌ، فَكَذَلِكَ الرُّسُلُ تُبْتَلَى ثُمَّ تَكُونُ لَهُمُ الْعَاقِبَةُ‏.‏
Reference : Sahih al-Bukhari 2804
In-book reference : Book 56, Hadith 21
USC-MSA web (English) reference : Vol. 4, Book 52, Hadith 60
  (deprecated numbering scheme)