My brothers and sisters, whenever you face trials of any kind, consider it nothing but joy, because you know that the testing of your faith produces endurance; and let endurance have its full effect, so that you may be mature and complete, lacking in nothing.
If any of you is lacking in wisdom, ask God, who gives to all generously and ungrudgingly, and it will be given you.
The New Oxford Annotated Bible with Apocrypha, New Revised Standard Version makes the interesting observation that though trials are meant to give us wisdom, we can ask God for wisdom in the midst of, and before that process is complete (my interpretation of what is said there). We desperately do need God’s wisdom along the way to help us. Trials are not easy to go through, and yes, while we consider such as nothing but joy, anticipating the maturity with the wisdom that comes out of that, nevertheless along the way we not only can, but this passage seems to suggest that we should ask God for needed wisdom.
This seems to me to be another padding helping us through this process. We know good is going to come out of it, if we hang in there and go through it. And God is present to give us wisdom to help us do so. A wisdom not meant to replace the process, but instead to help us through it. In and through Jesus.