Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ServiceBus] remove network trace params from extra in pyamqp logging #34365

Closed

fix param order in log

3a55e37
Select commit
Loading
Failed to load commit list.
Closed

[ServiceBus] remove network trace params from extra in pyamqp logging #34365

fix param order in log
3a55e37
Select commit
Loading
Failed to load commit list.
Azure Pipelines / python - eventhub - ci failed Feb 22, 2024 in 24m 15s

Build #20240222.4 had test failures

Details

Tests

  • 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

See this annotation in the file changed.

@azure-pipelines 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

See this annotation in the file changed.

@azure-pipelines 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

See this annotation in the file changed.

@azure-pipelines 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

See this annotation in the file changed.

@azure-pipelines 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]

See this annotation in the file changed.

@azure-pipelines 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]

See this annotation in the file changed.

@azure-pipelines 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]

See this annotation in the file changed.

@azure-pipelines 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]

See this annotation in the file changed.

@azure-pipelines 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