kytos-ng / kytos-end-to-end-tests

Kytos End-to-End Tests
0 stars 10 forks source link

`test_e2e_06_topology.py::TestE2ETopology::test_015_delete_link` rerun #309

Closed viniarck closed 5 days ago

viniarck commented 1 month ago

test_e2e_06_topology.py::TestE2ETopology::test_015_delete_link had a rerun. This test case can be improved to avoid reruns, it passed later, it's worth reviewing if the sleep/wait values need to be adapted. In this case, probably the link hadn't been discovered by that point due to some overload in the container?

rerun: 0
tests/test_e2e_06_topology.py::TestE2ETopology::test_015_delete_link: 2024-06-04,00:33:51.748923 - 2024-06-04,00:33:51.756765
self = <tests.test_e2e_06_topology.TestE2ETopology object at 0x7fa624e28e90>

    def test_015_delete_link(self):
        """Test api/kytos/topology/v3/links/{link_id} on DELETE.
        Deleted:
            - Link: JAX1 - JAX2
        """
        switch_1 = "00:00:00:00:00:00:00:22"
        switch_2 = "00:00:00:00:00:00:00:21"

        # Get the link_id
        api_url = f'{KYTOS_API}/topology/v3/links'
        response = requests.get(api_url)
        assert response.status_code == 200
        data = response.json()
        link_id = None
        for key, value in data['links'].items():
            endpoint_a = value["endpoint_a"]["switch"]
            endpoint_b = value["endpoint_b"]["switch"]
            if ((endpoint_a == switch_1 and endpoint_b == switch_2) or
                (endpoint_a == switch_2 and endpoint_b == switch_1)):
                link_id = key
                break
>       assert link_id
E       assert None

tests/test_e2e_06_topology.py:79: AssertionError
=========================== rerun test summary info ============================
RERUN tests/test_e2e_06_topology.py::TestE2ETopology::test_015_delete_link
= 239 passed, 8 skipped, 9 xfailed, 7 xpassed, 1295 warnings, 1 rerun in 12234.04s (3:23:54) =

Assigning this to you @Alopalao to add to your radar to reassess what can be done better to improve stability of this and the other related deletion test cases.