Eliminating the busy wait spin at the end seems to resolve deadlock. Added further tests to try and narrow down failure case, and to see if the failure is waituntil specific