Good info by poster db above. What that means is your car’s computer is tattling on you. As you drive the engine computer is constantly monitoring for conditions that could yield higher than allowed tailpipe emissions. To do that it performs a series of tests, each under a different driving condition, what they call a “drive cycle”. For example test 1 may occur at idle, test 2 at 35 mph with the coolant above 180 degrees, test 3 occurs at 55 mph with the gas tank more than 1/4 full, etc. After all those tests are completed , which may take a dozen driving trips or more, then the computer decides if that set of tests passes or not. If it passed each test, it puts a “pass” mark" for that set of tests, and a check mark in the “readiness monitor” column, meaning the engine performed all the required drive cycles and passed every one of the required tests.
If your Corolla failed b/c of a “drive cycle” problem, that means the emissions tester sees that one of the readiness monitors doesn’t have a check mark; i.e. all of the required drive cycles for that set of tests haven’t been completed yet. It doesn’t mean necessarily than any of the tests failed, just they haven’t been done yet. You might ask how that could be, since your car is15 years old. 15 years should be enough time to complete all those drive cycles, right?.
The problem is that the computer can forget it has already done the drive cycles. A mechanic can instruct the computer to forget, or if the battery is disconnected or a fuse pulled, all the prior drive cycle info is lost. The emissions folks, as you might expect, won’t pass the car until the necessary drive cycles are completed and each test passes. What you’d need to do is drive a car normally for a couple weeks, then take it to your shop and ask them to check the drive cycle readiness monitors, if they are completed enough to take the car for an emissions test. Your mechanic should also check for diagnostic codes which might prevent a successful emissions test. If you post the state of the readiness monitors and any diagnostic codes here, you might get some ideas what is involved to fix the problem.
I should add I own a Corolla of older vintage than yours, and do battle the Calif emissions test every two years. A car of its vintage has to be tail-pipe tested on a treadmill gadget, like it is being driven in other words. The problem for me is the tailpipe HC levels when it is driven at 15 mph. It passes all the other tests ok. But that one particular one it is right on the margin. I usually have to give it a complete ignition system tune-up and an injector cleaning treatment to get it to pass. In your case I think all you have to do is pass the computer’s drive cycle tests, no tread mill tailpipe testing.