It can often be extremely complex to completely get a PCM ready for emissions testing. I once spent several days with a very complex and long set of driving instructions called a "Drive Cycle" that I had to complete properly before it was ready for emissions testing. The list wouldn't usually take days to complete if each step was done perfectly but it's not always possible when you run into traffic that prevents the instructions from being followed. I finally had to drive way out into the desert so I could find long empty stretches of highway that would allow the steps to be completed exactly as required.
This shows one typical drive cycle, though my daily driver Genesis was way more complex. I hated having to do it.
https://repairpal.com/how-to-perform-a-basic-drive-cycle