Fix race condition in test by using a request