Direct numerical and large eddy simulations of incompressible turbulent flows over deep and shallow cavies were performed in the range of 600 <= Re(D) <= 12, 000 to investigate the influence of the incoming turbulent boundary layer on self-sustained oscillations of the shear layer. When the turbulent boundary layer approached the open cavity with Re(D) = 3000, the energy spectra of the pressure fluctuations showed spectral peaks in the range of 0.15 <= omega <= 0.3. Conditionally averaged flowfields disclosed that the spectral peaks arise from the separation of high-speed streaky structures rather than from a geometric singularity of the cavity. The same spectral peaks were observed in a backward-facing step flow as well as in deep and shallow cavity flows, despite the different geometries of these systems. In the turbulent cavity flow of Re(D) = 12, 000, however, the peak frequencies of the energy spectra cavity lengths of L/D = land 2 were found to correspond to the Nth modes with N = 2 and 3, respectively. These modes were very similar to the frequency characteristics of self-sustained oscillations reported for laminar cavity flows. Inspection of instantaneous pressure fluctuations as well as spanwise-averaged pressure fluctuations reversed that regular shedding of quasi-two-dimensional vortical structures was responsible for the peak frequency in the energy spectra.