The test is not for his benefit, but for ours.
I always entertained two theories here. First that an angel (now Satan) questioned God’s judgment on something.
Secondly, that they rebelled because of the Second Person of the Trinity, becoming man, and yet ranking ahead of them because He (Christ) was still God.
Also another thought — that the angels were jealous of Mary — that she should give birth to the Son of God, only begotten of the Father through the Holy Spirit.