Make test more robust

Test would periodically fail due to expect timing.
This seems to fix the problem