TestInsertQueue.test_insert_queue_header_asterisk failed with 204 != 201

Bug #1284995 reported by Feilong Wang on 2014-02-26
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zaqar
Medium
Feilong Wang

Bug Description

More details: http://paste.openstack.org/show/72691/

In my local development environment, I'm running into this failure. But obviously, it's weird why it's not reported by Jenkins.

FAIL: tests.functional.wsgi.v1.test_queues.TestInsertQueue.test_insert_queue_header_asterisk
tags: worker-0
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:'marconi'
  stderr

Traceback (most recent call last):
  File "tests/functional/wsgi/v1/test_queues.py", line 166, in test_insert_queue_header_asterisk
    self.assertEqual(result.status_code, 201)
  File "/home/flwang/MyWorkSpace/workspace_community/marconi/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 321, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/flwang/MyWorkSpace/workspace_community/marconi/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: 204 != 201

Feilong Wang (flwang) wrote :

I'm wondering if there are something wrong with the created check, see
https://github.com/openstack/marconi/blob/master/marconi/queues/transport/wsgi/v1_0/queues.py#L43

Changed in marconi:
assignee: nobody → Fei Long Wang (flwang)
Feilong Wang (flwang) wrote :

It would be appreciated if anybody can verify this with your own env.

Feilong Wang (flwang) on 2014-02-26
description: updated
Feilong Wang (flwang) wrote :

Just verified, this works with a running Marconi server. Not sure if it's caused by cached sqlite database. Will dig into it.

Changed in marconi:
status: New → Confirmed
Allele Dev (alleledev) on 2014-03-05
Changed in marconi:
importance: Undecided → Medium
description: updated

Can reproduce in master

## Trace

vkmc@icehouse:/opt/stack/marconi$ python setup.py testr
running testr
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t . ./tests
/opt/stack/oslo.vmware/oslo/__init__.py:15: UserWarning: Module tests was already imported from tests/__init__.pyc, but /usr/local/lib/python2.7/dist-packages is being added to sys.path
/opt/stack/oslo.vmware/oslo/__init__.py:15: UserWarning: Module tests was already imported from tests/__init__.pyc, but /usr/lib/python2.7/dist-packages is being added to sys.path
======================================================================
FAIL: tests.functional.wsgi.v1.test_queues.TestInsertQueue.test_insert_queue_header_asterisk
tags: worker-0
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:'marconi'
  stderr

Traceback (most recent call last):
  File "tests/functional/wsgi/v1/test_queues.py", line 166, in test_insert_queue_header_asterisk
    self.assertEqual(result.status_code, 201)
  File "/usr/local/lib/python2.7/dist-packages/testtools/testcase.py", line 321, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/local/lib/python2.7/dist-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: 204 != 201
2014-03-05 19:07:29.007 3190 WARNING marconi.common.pipeline [-] Stage <tests.unit.common.test_pipeline.FirstClass object at 0x44eb750> does not implement does_not_exist
2014-03-05 19:07:29.023 3190 WARNING marconi.common.pipeline [-] Stage <tests.unit.common.test_pipeline.SecondClass object at 0x44eb790> does not implement does_not_exist
2014-03-05 19:07:29.023 3190 ERROR marconi.common.pipeline [-] Method does_not_exist not found in any of the registered stages
2014-03-05 19:07:30.927 3190 WARNING keystoneclient.middleware.auth_token [-] Configuring auth_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
======================================================================
FAIL: process-returncode
tags: worker-0
----------------------------------------------------------------------
Binary content:
  traceback (test/plain; charset="utf8")
Ran 644 tests in 13.226s (+2.700s)
FAILED (id=3, failures=2 (-11), skips=290)
error: testr failed (1)

Feilong Wang (flwang) wrote :

I can't recreate this now with the latest code(master branch).

Changed in marconi:
status: Confirmed → Invalid
status: Invalid → Confirmed
prashanth raghu (p-isprashanth) wrote :

Observed in master.

Steps to reproduce this bug:
--------------------------------------

1. After running marconi-server, run the unit tests using tox -e py27.
2. Now you will notice that all the tests pass successfully.
3. From your REST client issue a GET request using http://127.0.0.1:8888/queues .
4. You will observe that there is a queue named : "asteriskinheader".
5. Now run the tests again executing : tox -e py27.

You can observe that because of the already existing queue a 204 response is observed.
The response can be traced back to the code queues.py in line number 51 where HTTP_204 is added to the response for already existing queues.

Fix proposed to branch: master
Review: https://review.openstack.org/83016

Changed in marconi:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/83016
Committed: https://git.openstack.org/cgit/openstack/marconi/commit/?id=b6efb90a0bb326c0671d3fa240d61ce10b74c21a
Submitter: Jenkins
Branch: master

commit b6efb90a0bb326c0671d3fa240d61ce10b74c21a
Author: Fei Long Wang <email address hidden>
Date: Wed Mar 26 17:19:39 2014 +0800

    Improve cleanup of test_insert_queue_header_asterisk

    Based on current implement, the queue created by
    test_insert_queue_header_asterisk won't be deleted.
    As a result, develper will run into unit test failure
    like 204!=201. This fix will add the headers param to
    make sure the queue can be cleaned up.

    Closes-Bug: #1284995

    Change-Id: If415c4f73604ae0f9d2d37daba3aa3f0ca693b6a

Changed in marconi:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2014-04-16
Changed in marconi:
milestone: none → icehouse-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-04-17
Changed in marconi:
milestone: icehouse-rc1 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers