My car needs to get a ny inspection like last month but my check engine light is on. i know its a po401 egr code and im on my way now to get some intake cleaner to clean the egr. my question is once i clear the engine light how long must i wait or drive befor i can get it inspected. i was told if you go right away the machine knows it had a error code and will fail me. is it a amount of time or miles i have to wait?

thanks