Depends what you mean by obsolete or failure.
If you are doing the SAME things for the next 10 years, then computer will be the same.
Nobody can tell what the killer app is going to be down the line. If you do microsoft office, maybe play some casual facebook games, watch youtube and maybe other videos. You can do all these things with a PC from 10years ago.
So you can use that same concept and extrapolate to the future.
Heck, on my brand new computer, I'm using my copy of Office 97 (since it's paid for), which is not even supported by Microsoft anymore.
As far as actual FAILURE,
It is estimated that a consumer piece of hardware should last at least 10 years, and usual failure is somewhere between the 20-30year mark. This is estimated and calculated with formulas and stresstesting since nobody has time machines to go 30years into the future to see actual computers failing..
So no, they will not last forever, you will WEAR out the transistors same as your incandescent lightbulb eventually dims out.