Profile photo for Dave Wade-Stein

You could put the infinite loop in a thread, test the thread, and then stop the thread by having the test set a variable that the thread periodically inspects and exits if the variable is set to True.

Or otherwise set things up so that loop is infinite in production, but finite when under test.

View question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025