Fix query and assertions.
Optimise the imports in test_chgrp.py.
Add xfail marker.