async def METHOD_NAME(self, recorded_test, monitor_info):
    credential = self.get_credential(LogsIngestionClient, is_async=True)
    client = self.create_client_from_credential(
        LogsIngestionClient, credential, endpoint=monitor_info['dce'])
    body = [{"foo": "bar"}]
    async def on_error(e):
        on_error.called = True
        assert isinstance(e.error, HttpResponseError)
        assert e.failed_logs == body
    on_error.called = False
    async with client:
        await client.upload(
            rule_id='bad-rule', stream_name=monitor_info['stream_name'], logs=body, on_error=on_error)
    assert on_error.called
    await credential.close()