Fix test on linux - state changes are not instant

Change-Id: I0e6808179afa09918882d8af8ca8c98236a1daa1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>