Rewrite of tests using co + complete checks of states + use polling instead of sleep