When I initially tried this code it didn’t work. To figure out why autotest thought it had to keep running I ran the following:

find ./ -cmin -1

This will show you any files that changed in the last minute. I had to add db, log, system and public to the list above. Depending on your configuration you might run into other files or folders that need to be excluded.