test_runner test_wait_for_instance_fails test fails on fuzzy string matching

Bug #1372362 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu CI Engine
Fix Released
Medium
Martin Pitt

Bug Description

I deployed the current (r791) uci-airline's "test-runner" component into BootStack, and ran the tests with "./run-tests ^test_runner". Most tests succeed, but there is one failure:

======================================================================
FAIL: test_runner.tstrun.tests.test_testbed.TestTestbed.test_wait_for_instance_fails
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_runner/tstrun/tests/test_testbed.py", line 267, in test_wait_for_instance_fails
    unicode(cm.exception))
  File "/usr/lib/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 924, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python2.7/unittest/case.py", line 410, in fail
    raise self.failureException(msg)
AssertionError: u'Instance never came up (last status: BUILD)' != u'Instance 39b7a267-b2f9-480b-9fc0-50f3e5aae23b never came up (last status: BUIL [truncated]...
- Instance never came up (last status: BUILD)
+ Instance 39b7a267-b2f9-480b-9fc0-50f3e5aae23b never came up (last status: BUILD)

This is easy enough to fix with something like

--- test_runner/tstrun/tests/test_testbed.py…………2014-08-24 21:27:36 +0000
+++ test_runner/tstrun/tests/test_testbed.py…………2014-09-22 09:08:25 +0000
@@ -263,8 +263,9 @@
         self.addCleanup(tb.teardown)
         with self.assertRaises(testbed.TestBedException) as cm:
             tb.setup()
- self.assertEqual('Instance never came up (last status: BUILD)',
- unicode(cm.exception))
+ self.assertRegexpMatches(
+ unicode(cm.exception),
+ 'Instance \S+ never came up \(last status: BUILD\)')

     def test_wait_for_ip_fails(self):
         self.conf.set('vm.image', self.get_image_id())

but before filing an MP I'd like to get a second opinion whether this is intended.

Related branches

Revision history for this message
Martin Pitt (pitti) wrote :

The MP now accepts either variant of the error message.

Ubuntu CI Bot (uci-bot)
Changed in uci-engine:
status: New → Fix Committed
Vincent Ladeuil (vila)
Changed in uci-engine:
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Medium
milestone: none → uce-0
status: Fix Committed → Fix Released
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.