In general, if the pesto has significantly changed color and is no longer bright green but a darker shade or has gone brown, it's not good to eat. Scrape off the top layer and you might find freshness underneath. Also smell the pesto - if it smells bad or musty, then it is past it's time.