Add tests to ensure the right lifecycle.