(a)
A defendant may make a demand for inspection, copying, testing, or sampling without leave of court at any time.(b)
A plaintiff may make a demand for inspection, copying, testing, or sampling without leave of court at any time that is 10 days after the service of the summons on, or appearance by, the party to whom the demand is directed, whichever occurs first.(c)
Notwithstanding subdivision (b), in an unlawful detainer action or other proceeding under Chapter 4 (commencing with Section 1159) of Title 3 of Part 3, a plaintiff may make a demand for inspection, copying, testing, or sampling without leave of court at any time that is five days after service of the summons on, or appearance by, the party to whom the demand is directed, whichever occurs first.(d)
Notwithstanding subdivisions (b) and (c), on motion with or without notice, the court, for good cause shown, may grant leave to a plaintiff to make a demand for inspection, copying, testing, or sampling at an earlier time.
Source:
Section 2031.020, https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=CCP§ionNum=2031.020.
.