It says He learned obedience, but it doesn't say "when", or which sufferings and when those sufferings were, etc...
I propose that it was long before He was even baptized, things He had to learn as a child, then later on when He became a man, and when He knew His obedience as a "son of man" was made perfect or perfected, then his obedience as a Son of God, the first (born) Son of God, was made perfect right before His ministry, right after He was baptized, then led into the wilderness by the Holy Spirit, to be tempted by/of the Devil. I propose that it was at that point in time, after His fasting and being tempted with some of the most difficult of His or anyone's life's/lives temptations as a/the (first) (born) (by fire) (by those temptations) Son of God, that it was after that He was made perfect and perfectly complete, then He went out to do His ministry or God' work, healing's, evidence of the supernatural, proving who He was, etc, etc, etc... Teachings (wisdom) of a kind none had ever heard ever before, etc, more evidence of who He was, etc, and that He had the Spirit of the Most Holy God in Him and with Him, living and residing inside of Him, etc...
The Cross seemed to be one final test, a "revisiting" of things maybe, at what would be the moment of His greatest weakness, etc, (however He showed out and proved Himself to be anything but "weak", etc) Anyway, the Cross seemed to be one final test, to make sure I guess maybe, something that He would have to do and pass as the firstborn among men who would become the Sons of God after Him, etc...
He is the Messiah because of this, cause He never failed, never had to repeat or take any of the same kind of test over again, defeated any and all temptations at their onset, unlike so very many of us have to much of the time, but He learned perfect obedience through those tests, trials, temptations, things He had suffered in and throughout His entire life, "before" He was made perfect, (most of which happened long before He was even baptized), etc...
So you could say He was tempted in all ways as we are, but if He was actually tempted at all, it didn't last very long as He crushed and defeated them all at their onset, and they never came up again for Him, etc, unlike so many of us, etc...
At the cross some of those things might have came back to Him maybe, but He showed Himself out to be anything but weak against them, etc...
God Bless!