Skip to content

Commit

Permalink
Fix bug with port status checking in test_snapshot
Browse files Browse the repository at this point in the history
We had a bug in product code that was recently fixed by
projectcalico#6979.  That bug caused some port statuses to be
signalled as "None" when they should not be.

Unfortunately we also had this test (test_snapshot) that had been coded to match the bug, i.e. to
expect a port status update of "None".  The correct behaviour is that the port status should not be
changed by this passage of test code.

This was missed at the time of the 6979 PR because our UT running had a bug that allowed some tests
to fail but still reported success overall.
  • Loading branch information
nelljerram committed Jan 17, 2023
1 parent be43896 commit a73dd50
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1783,16 +1783,16 @@ def _cancel():
mock.call("hostname", "ep1", {"status": "up"}, priority="low"),
], any_order=True)

# Resync after deleting the Felix status. We should see the other
# endpoint reported with status None.
# Resync after deleting the Felix status. This does not affect the
# status of ep1.
del self.etcd_data[felix_status_key]
self.driver.on_felix_alive.reset_mock()
self.driver.on_port_status_changed.reset_mock()
self.clientv3.watch_prefix.return_value = _iterator(), _cancel
self.watcher.start()
self.driver.on_felix_alive.assert_not_called()
self.driver.on_port_status_changed.assert_has_calls([
mock.call("hostname", "ep1", None, priority="low"),
mock.call("hostname", "ep1", {"status": "up"}, priority="low"),
], any_order=True)

# Resync with some follow-on events; checks that the priority goes
Expand Down

0 comments on commit a73dd50

Please sign in to comment.