[ServiceBus] remove network trace params from extra in pyamqp logging #34365
Build #20240222.4 had test failures
Details
- Failed: 96 (3.55%)
- Passed: 1,192 (44.08%)
- Other: 1,416 (52.37%)
- Total: 2,704
Annotations
Check failure on line 12025 in Build log
azure-pipelines / python - eventhub - ci
Build log #L12025
The process '/opt/hostedtoolcache/Python/3.9.18/x64/bin/python' failed with exit code 1
Check failure on line 11539 in Build log
azure-pipelines / python - eventhub - ci
Build log #L11539
The process '/opt/hostedtoolcache/Python/3.8.18/x64/bin/python' failed with exit code 1
Check failure on line 45 in Build log
azure-pipelines / python - eventhub - ci
Build log #L45
There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.
Check failure on line 45 in Build log
azure-pipelines / python - eventhub - ci
Build log #L45
There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.
Check failure on line 1 in test_link_should_detach[link attached]
azure-pipelines / python - eventhub - ci
test_link_should_detach[link attached]
KeyError: 'amqpConnection'
Raw output
start_state = <LinkState.ATTACHED: 3>
expected_state = <LinkState.DETACH_SENT: 4>
@pytest.mark.parametrize(
"start_state,expected_state",
[
(LinkState.ATTACHED, LinkState.DETACH_SENT),
(LinkState.ATTACH_SENT, LinkState.DETACHED),
(LinkState.ATTACH_RCVD, LinkState.DETACHED),
],
ids=["link attached", "link attach sent", "link attach rcvd"],
)
def test_link_should_detach(start_state, expected_state):
session = Mock()
link = Link(
session,
3,
name="test_link",
role=True,
source_address="test_source",
target_address="test_target",
network_trace=False,
network_trace_params={},
)
assert link.state == LinkState.DETACHED
> link._set_state(start_state)
tests/pyamqp_tests/unittest/test_link.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <azure.eventhub._pyamqp.link.Link object at 0x7fb77fef0520>
new_state = <LinkState.ATTACHED: 3>
def _set_state(self, new_state: LinkState) -> None:
"""Update the link state.
:param ~pyamqp.constants.LinkState new_state: The new state.
"""
if new_state is None:
return
previous_state = self.state
self.state = new_state
_LOGGER.info(
"[Connection:%s, Session:%s, Link:%s] Link state changed: %r -> %r",
> self.network_trace_params["amqpConnection"],
self.network_trace_params["amqpSession"],
self.network_trace_params["amqpLink"],
previous_state,
new_state
)
E KeyError: 'amqpConnection'
.tox/mindependency/lib/python3.9/site-packages/azure/eventhub/_pyamqp/link.py:137: KeyError
Check failure on line 1 in test_link_should_detach[link attach sent]
azure-pipelines / python - eventhub - ci
test_link_should_detach[link attach sent]
KeyError: 'amqpConnection'
Raw output
start_state = <LinkState.ATTACH_SENT: 1>
expected_state = <LinkState.DETACHED: 0>
@pytest.mark.parametrize(
"start_state,expected_state",
[
(LinkState.ATTACHED, LinkState.DETACH_SENT),
(LinkState.ATTACH_SENT, LinkState.DETACHED),
(LinkState.ATTACH_RCVD, LinkState.DETACHED),
],
ids=["link attached", "link attach sent", "link attach rcvd"],
)
def test_link_should_detach(start_state, expected_state):
session = Mock()
link = Link(
session,
3,
name="test_link",
role=True,
source_address="test_source",
target_address="test_target",
network_trace=False,
network_trace_params={},
)
assert link.state == LinkState.DETACHED
> link._set_state(start_state)
tests/pyamqp_tests/unittest/test_link.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <azure.eventhub._pyamqp.link.Link object at 0x7fb780f31d00>
new_state = <LinkState.ATTACH_SENT: 1>
def _set_state(self, new_state: LinkState) -> None:
"""Update the link state.
:param ~pyamqp.constants.LinkState new_state: The new state.
"""
if new_state is None:
return
previous_state = self.state
self.state = new_state
_LOGGER.info(
"[Connection:%s, Session:%s, Link:%s] Link state changed: %r -> %r",
> self.network_trace_params["amqpConnection"],
self.network_trace_params["amqpSession"],
self.network_trace_params["amqpLink"],
previous_state,
new_state
)
E KeyError: 'amqpConnection'
.tox/mindependency/lib/python3.9/site-packages/azure/eventhub/_pyamqp/link.py:137: KeyError
Check failure on line 1 in test_link_should_not_detach[link detached]
azure-pipelines / python - eventhub - ci
test_link_should_not_detach[link detached]
KeyError: 'amqpConnection'
Raw output
state = <LinkState.DETACHED: 0>
@pytest.mark.parametrize(
"state",
[LinkState.DETACHED, LinkState.DETACH_SENT, LinkState.ERROR],
ids=["link detached", "link detach sent", "link error"],
)
def test_link_should_not_detach(state):
session = None
link = Link(
session,
3,
name="test_link",
role=True,
source_address="test_source",
target_address="test_target",
network_trace=False,
network_trace_params={},
)
assert link.state == LinkState.DETACHED
> link._set_state(state)
tests/pyamqp_tests/unittest/test_link.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <azure.eventhub._pyamqp.link.Link object at 0x7fb77fe8f040>
new_state = <LinkState.DETACHED: 0>
def _set_state(self, new_state: LinkState) -> None:
"""Update the link state.
:param ~pyamqp.constants.LinkState new_state: The new state.
"""
if new_state is None:
return
previous_state = self.state
self.state = new_state
_LOGGER.info(
"[Connection:%s, Session:%s, Link:%s] Link state changed: %r -> %r",
> self.network_trace_params["amqpConnection"],
self.network_trace_params["amqpSession"],
self.network_trace_params["amqpLink"],
previous_state,
new_state
)
E KeyError: 'amqpConnection'
.tox/mindependency/lib/python3.9/site-packages/azure/eventhub/_pyamqp/link.py:137: KeyError
Check failure on line 1 in test_link_should_detach[link attach rcvd]
azure-pipelines / python - eventhub - ci
test_link_should_detach[link attach rcvd]
KeyError: 'amqpConnection'
Raw output
start_state = <LinkState.ATTACH_RCVD: 2>
expected_state = <LinkState.DETACHED: 0>
@pytest.mark.parametrize(
"start_state,expected_state",
[
(LinkState.ATTACHED, LinkState.DETACH_SENT),
(LinkState.ATTACH_SENT, LinkState.DETACHED),
(LinkState.ATTACH_RCVD, LinkState.DETACHED),
],
ids=["link attached", "link attach sent", "link attach rcvd"],
)
def test_link_should_detach(start_state, expected_state):
session = Mock()
link = Link(
session,
3,
name="test_link",
role=True,
source_address="test_source",
target_address="test_target",
network_trace=False,
network_trace_params={},
)
assert link.state == LinkState.DETACHED
> link._set_state(start_state)
tests/pyamqp_tests/unittest/test_link.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <azure.eventhub._pyamqp.link.Link object at 0x7fb77fdf5a90>
new_state = <LinkState.ATTACH_RCVD: 2>
def _set_state(self, new_state: LinkState) -> None:
"""Update the link state.
:param ~pyamqp.constants.LinkState new_state: The new state.
"""
if new_state is None:
return
previous_state = self.state
self.state = new_state
_LOGGER.info(
"[Connection:%s, Session:%s, Link:%s] Link state changed: %r -> %r",
> self.network_trace_params["amqpConnection"],
self.network_trace_params["amqpSession"],
self.network_trace_params["amqpLink"],
previous_state,
new_state
)
E KeyError: 'amqpConnection'
.tox/mindependency/lib/python3.9/site-packages/azure/eventhub/_pyamqp/link.py:137: KeyError