How do I get a 2003 Malibu computer to reset, so I can complete NYS annual inspection?

I have a 2003 Chevy Malibu. the check engine light came on and my mechanic said it was a general error code, probably a loose gas cap. After the cap was tightened the problem resolved. However, a week later I took the car in for NYS annual inspection and was told the car’s comuter had not “reset” yet, so the inspection couldn’t be performed. (the check engine light has remained off since the gas cap was tightened) My round trip work comute is only 8 miles (all city street driving), so I only put ~ 40 miles on the car in the week between the engine light going on, and when I attempted to have the car inspected. The mechanic advised me to drive the car on the highway to get the computer to reset. Is there an approximate number of miles I need to drive to get the computer to reset, and is the mechanic correct that I have to drive it on the highway to get it to reset? I need to have the inspection performed by the end of the month, so any advice would be appreciated. Thank You!

You do need to drive car aprox 50 miles for it to reset. So just go as you are, and if the light does not come on, it will be fine in 10 to 25 miles.

Somewhere along the way, it needs a few minutes at highway speed…

A “general error code” and “probably a gas cap” sounds pretty hazy to me.

Thank you for the suggestions.

I may have have misquoted my mechanic when he said it was a “general error code”. What he meant was the code did not refer to a specific site of malfunction, and explained a loose gas cap is the most common reason for this problem. I have no reason to doubt my mechanic’s diagnosis because the CEL has remained off since he tightened the gas cap over a week ago, and he did not charge me for the visit.