fix non-determininistic reference counting segment test

are we guaranteed the test won't get stuck if something fails the test?