It can be difficult to determine when an agent upgrade has actually completed on Windows, because a sequence of events must occur:
- the current puppet run must complete
- the install_puppet.bat file must wait 5 seconds, then infinite loops until a given PID is no longer running (from last Puppet run)
- the actual MSI must run to completion (it can actually encounter issues if for some reason any Puppet processes are still running)
If any other process (such as tests) want to synchronize / wait until the install has completed, there is no great way to do so cross-process.
To improve this process, the install_puppet.bat can be modified to write a PID file to %temp% that other processes may observe.