# Test ContextService ability to handle disconnections, including handling # cleanup of dependent (via=) contexts. - name: integration/context_service/reconnection.yml hosts: test-targets any_errors_fatal: true tasks: - mitogen_shutdown_all: - custom_python_detect_environment: register: ssh_account_env - become: true custom_python_detect_environment: register: old_become_env - become: true shell: | bash -c "( sleep 3; kill -9 {{ssh_account_env.pid}}; ) & disown" - connection: local shell: sleep 3 - wait_for_connection: - become: true custom_python_detect_environment: register: new_become_env # Verify the PIDs really changed (i.e. disconnection happened) - assert: that: - old_become_env.pid != new_become_env.pid