Portage currently adds the root directory (/) to SANDBOX_PREDICT while executing the src_test function. https://gitweb.gentoo.org/proj/portage.git/tree/bin/phase-functions.sh?h=portage-3.0.30#n505 This effectively silences any sandbox denials that occur while running tests. I'm not sure this is really a good idea; it can end up masking file access issues during test execution. For example, see bug 836560.
The fallout from this is too much; it's disturbingly common for test suites to try things like rmdir / with failure as the expected result.