That is job control weirdness. Something about the state of tty magic is
different in the two different contexts where you run the test. The things
to look at are whether the tests are using a temporary pty and what 'ps j'
says about all the processes involved in the build/test (including mock and
its layers of whatever before the rpmbuild).