Fix flakey test

Eventually was being passed the result of openFileCount rather than
being passed the function. This meant we were accidentally 'polling'
an integer resulting in flakey tests.

[#78902702]