Could do not use explicit wait? We can wait for the global variable for a 5 sec and this test will be more stable.