Here is what I did last time (mine was on before my MD emissions). I made my repairs, reset the codes, and drove roughly 20 miles straight. Shut the vehicle off (got a Starbucks coffee), restarted, and went to the testing station. Passed, no issues. It is my understanding that 2 things were a must here:

- driving for a period of time so the ECU "learns".

- shut down and start back up so that the ECU "boots" on it's own "re-learned" package and most importantly, doesn't start with the codes again.

The drive and the restart are mostly to test your code reset, but at that point, the history should be reset from the restart. It's gonna come down to the issues your car had too, and whether you nipped the problem in the bud.