Using Pulumi's Node.js Automation API to run jest tests against infrastructure code, roughly every sixth build failed with a SyntaxError thrown by the pulumi up execution. Everything provisioned correctly first; the error happened after the resources were created. It only happened when the test also called stack.preview before stack.up, because the Automation API runs its readLines output handling during preview even without an onEvent handler.