Skip to content

sporadic TypeError in test_792_explicit_port_protocol #795

@rade

Description

@rade

We are seeing some sporadic failures in test_792_explicit_port_protocol:

============================= test session starts ==============================
platform linux2 -- Python 2.7.10 -- py-1.4.30 -- pytest-2.7.2
rootdir: /home/docker-py, inifile: 
plugins: cov
collected 25 items

tests/integration_test.py .....s..................F

=================================== FAILURES ===================================
_______________ TestRegressions.test_792_explicit_port_protocol ________________

self = <tests.integration_test.TestRegressions testMethod=test_792_explicit_port_protocol>

    def test_792_explicit_port_protocol(self):

        tcp_port, udp_port = random.sample(range(9999, 32000), 2)
        ctnr = self.client.create_container(
            BUSYBOX, 'true', ports=[2000, (2000, 'udp')],
            host_config=self.client.create_host_config(
                port_bindings={'2000/tcp': tcp_port, '2000/udp': udp_port}
            )
        )
        self.tmp_containers.append(ctnr)
        self.client.start(ctnr)
        self.assertEqual(
>           self.client.port(ctnr, 2000)[0]['HostPort'],
            six.text_type(tcp_port)
        )
E       TypeError: 'NoneType' object has no attribute '__getitem__'

tests/integration_test.py:1735: TypeError
=============== 1 failed, 23 passed, 1 skipped in 17.65 seconds ================

Note that this doesn't fail all the time.

This is presumably related to #793.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions