Merge "Add wait to UndefinedGroupPermissionTest" into tm-dev