add integration tests for leadership election