  Next-generation ground-based gravitational-wave observatories such as the
Einstein Telescope and Cosmic Explorer will detect $O(10^{5}-10^{6})$ signals
from compact binary coalescences every year, the exact number depending on
uncertainties in the binary merger rate. Several overlapping signals will be
present in band at any given time, generating a confusion noise background. We
study how this confusion noise affects constraints on possible deviations from
general relativity induced by modified gravity and environmental effects.
Confusion noise impacts only the signals that last longer in band. Even for a
"golden" GW170817-like signal, the constraints broaden by a factor in the range
$[10\%,40\%]$ $([70\%,110\%])$ for the fiducial (highest) value of the local
binary neutron star merger rate. Our ability to test general relativity or
constrain environmental effects will be limited by systematic errors, and not
by confusion noise.
