Sporadic failures of TestDiscovery.test_get_config_file

Bug #1797321 reported by Ilya Shakhat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Invalid
Undecided
Unassigned

Bug Description

Tempest test case tempest.tests.cmd.test_verify_tempest_config.TestDiscovery.test_get_config_file
fails randomly with:

Traceback (most recent call last):
  File "/home/zuul/src/git.openstack.org/openstack/tempest/tempest/tests/cmd/test_verify_tempest_config.py", line 591, in test_get_config_file
    os.path.isfile('%s/tempest.conf.sample' % (conf_dir)))
  File "/home/zuul/src/git.openstack.org/openstack/tempest/.tox/py35/lib/python3.5/site-packages/unittest2/case.py", line 702, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

The issue affects stability of 'openstack-tox-pyXX' jobs (though on py3x is occurs more frequently comparing to py27).

Recent failed jobs:
http://logs.openstack.org/09/608609/3/check/openstack-tox-py35/745b7b9/testr_results.html.gz
http://logs.openstack.org/35/523935/7/check/openstack-tox-py36/19d4973/testr_results.html.gz

Root cause
----------

The test case asks oslo.config to generate a configuration file and then immediately verifies file existance:
(http://git.openstack.org/cgit/openstack/tempest/tree/tempest/tests/cmd/test_verify_tempest_config.py#n596)

    init_cmd.generate_sample_config(os.path.join(conf_dir, os.pardir))
    self.assertTrue(os.path.isfile(local_sample_conf_file),
                    local_sample_conf_file)

However oslo_config.generate() function does not close the file, as result the data stays in memory and not always written to file system immediately.

Fix
---

The fix is already merged into oslo.config repo https://review.openstack.org/#/c/609011

Revision history for this message
Ilya Shakhat (shakhat) wrote :
Changed in tempest:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.