It depends on when I realize the game is mediocre.
The most recent examples I can think of are FF7 Rebirth and Mario and Luigi Brothership. I had fun with both of them at the beginning, but by the end it was a slog. I'm not necessarily calling them mediocre, but by the end I wasn't having fun. But, by the time that happened, I was far enough into them that I wanted to see the end, and in the case of Rebirth, I did genuinely want to see how the story played out.
But if a game is just not good from the outset, odds are if I bought it, I stopped very early on.