Lol, luckily there are a couple of rules to prevent infinite games in chess:
One is "draw by repetition", where if the same exact board state is reached 3x, the game ends automatically in a draw.
The other is the "50 move rule", where if no pieces are captured or pawns advanced in 50 turns, the game also ends in a draw.