SB 1.7 - Kṛṣṇa's test of His devotees
Kṛṣṇa said that Arjuna had also promised Draupadī that he would bring the head of the killer of her sons, and so asked Arjuna to kill Aśvatthāmā, who had dissatisfied his master Duryodhana, who never approved of the heinous act of killing the five sleeping sons of the Pāṇḍavas. Although Kṛṣṇa was examining Arjuna in religion and encouraged him to kill the son of Droṇa, Arjuna did not like the idea of killing him. Arjuna considered that the son of his great teacher should be spared, even though he was an unworthy son. Lord Kṛṣṇa encouraged Arjuna outwardly just to test Arjuna’s sense of duty. It is not that Arjuna was incomplete in the sense of his duty, nor was Kṛṣṇa unaware of Arjuna’s sense of duty. But Kṛṣṇa put to test many of His devotees just to magnify the sense of duty. The gopīs were put to such tests as well. Prahlāda Mahārāja also was put to test. All pure devotees come out successfully in the respective tests by the Lord.
Kṛṣṇa tested Arjuna, possessor of dharma, by showing vīra and raudra rasas when He said that Arjuna should not release Aśvatthāmā. In the same way He tested the gopīs, possessors of prema, by showing karma and jñāna in such verses as SB 10.29.24: the highest duty for a woman is to serve her husband; and in SB 10.47.29: the gopīs are never separated from Kṛṣṇa, for He is the soul of all creation. Kṛṣṇa also tested Pṛthu, Prahlāda and others, who were filled with devotion, by promising enjoyment and powers to them. In SB 4.20.16 He said Pṛthu could ask any benediction from Him; and in SB 7.9.52 He said Prahlāda could fulfill his desire by asking any benediction. Even Kṛṣṇa’s siddhi devotees test others. Thus Śukadeva tests Parīkṣit. In the 6th canto, he tests his knowledge of siddhānta when he speaks of regular atonements when Parīkṣit asks the method of getting free from sins. In the 9th canto, he tests Parīkṣit’s eagerness for Kṛṣṇa’s pastimes by summarizing those pastimes, and in the 12th canto, he tests his steadiness in bhakti by talking of brahma-jñāna. The real meaning is not always in the directly observed events.