Merge "Add a test to verify lifecycle events are triggered" into pi-dev