fix non-determininistic reference counting segment test