In the test, it is possible that the resource is committed before the test starts waiting so use a field to check for that