We were performing an AJAX request and then a "normal" request without checking the AJAX request had finished. Sometimes it resulted in the normal request finishing because the AJAX request did, causing the test to fail.