At the beginning of your upkeep, if you have 50 or more life, you win the game.
Test of Endurance’s ability will check your life total as your upkeep begins, before any player has the opportunity to take any actions. If you don’t have 50 or more life at that time, the ability won’t trigger at all. If the ability does trigger, it will check again as it tries to resolve. If your life total has fallen below 50 at that point, the ability won’t have any effect.