TestTimer breaks VPNaaS functional tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Some functional tests for neutron-vpnaas make use of the NamespaceFixture.
If the tests are run in combination with a recent neutron version some tests
fail because the TestTimer raises a TestTimerTimeout even if the namespace
cleanup finishes before the timeout.
In the test setup the tox env for dsvm-functional
install neutron 17.0.0 (victoria), but for my tests I needed a recent
neutron, so I installed it as an additional step in the setup of the tox env.
The test setup steps are like these, on an Ubuntu 20.04 host:
git clone https:/
git clone https:/
git clone https:/
cd neutron-vpnaas
VENV=dsvm-
tox -e dsvm-functional
source .tox/dsvm-
python -m pip install ../neutron
deactivate
Then run the neutron-vpnaas functional tests:
tox -e dsvm-functional
Some tests fail and you see the TestTimerTimeout exception.
The tests were fine with neutron 17.0.0.
The TestTimer was introduced later.
See
Change set https:/
Related bug https:/
I could narrow the problem with the TestTimer down.
In at least one neutron-vpnaas test
(neutron_
the NamespaceFixture is used.
The TestTimer is set up, the test completes and the namespace is deleted
successfully before the 5 seconds of the timer are over. But shortly after
that the timer still fires.
The problem is the following: on timer start the old signal handler is
stored (Handler.SIG_DFL in my case) and the remaining time of any existing
alarm (in my case 0). On exit the signal handler is supposed to be reset
and the alarm too. But neither happens.
The signal handler is not set back, because Handler.SIG_DFL is falsy.
The alarm is not stopped because the old value was 0 (there was no ongoing
alarm). So in the end the alarm started by TestTimer will eventually be
signalled.
References:
Change set where the TestTimer was introduced:
https:/
That related to bug #1838793
Changed in neutron: | |
status: | New → Triaged |
Changed in neutron: | |
status: | Triaged → In Progress |
Changed in neutron: | |
status: | In Progress → Fix Committed |
Changed in neutron: | |
status: | Fix Committed → Fix Released |
Added a fix: https:/ /review. opendev. org/c/openstack /neutron/ +/771436