i put a brand new cat on my mazda, and did the test literally right afterwards, like within 3 minutes, pulled it off the rack and smogged it, ran it at 4500rpm for about a minute or two to burn the crap off inside it, and i passed with flying colors, better than brand new actually.
also being "21 degrees" off is probably advanced, when i took my truck in it was at 21 degrees advance and is only suppose to be at 6 degrees. and it was running top notch.
the easiest way to be certain to pass emissions is thing, gap your plugs a decent amount (not too far because then you will blow out the spark with compression) and put like a pint of airplane fuel in your tank along with about a 1/4 of gas, this will make it run awesome, i have seen an accord (my old 1980 hatchback) blowing smoke like crazy and i did those two things and it passed and nobody knew how lol. anyway good luck. OH and in california your idle can be legally 1100rpm at idle and still pass idle test so crank that biotch up to 1100 for idle, we did on my mazda.. and heres my reults...