The testing of ones Faith while not comfortable will indeed yield the intended outcome, for we all stumble from time to time, and it’s in this that we find our thinking not only is challenged but needs Gods righteous judgement.
His judgement is always to restore, to build and encourage one, while convicting one of the offense. This conviction leads to godly sorrow, and repentance, which is turning more fully to The One True God.
It’s in this testing that one deepens Trust in God knowing that His discipline always yields Fruit, for His discipline is truly and always an expression of Love.
As James states, “Consider it all joy, my brethren, when you encounter various trials, knowing that the testing of your faith produces endurance. And let endurance have perfect result, so that you may be perfect and complete, lacking in nothing.”