Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmpp_tests.SendAndReceiveTest fails intermittently with AssertionError 'message_recieved' != 'non-existent' #170

Open
scragraham opened this issue Aug 2, 2019 · 0 comments

Comments

@scragraham
Copy link
Contributor

Near the end of the test we have code that looks like this:

    # Ensure the XMPP message has been received by the application.
    message_received = False
    for _ in range(5):
      response = self.http_get('/xmpp')
      xmpp_info = json.loads(response.payload)
      self.assertEquals(response.status, 200)
      self.assertTrue(xmpp_info['status'])
      if xmpp_info['state'] == 'message received!':
        message_received = True
        break
      time.sleep(1)

    self.assertTrue(message_received)

    # finally, clean up the mess we made for this test
    response = self.http_delete('/xmpp')
    self.assertEquals(response.status, 200)

    # and we should see no metadata
    response = self.http_get('/xmpp')
    xmpp_info = json.loads(response.payload)
    self.assertEquals(response.status, 200)
    self.assertTrue(xmpp_info['status'])
    self.assertEquals(xmpp_info['state'], 'non-existent')

Looking at the java application logs:

INFO hawkeye Response: 200 http://40.121.41.66:8080/java/xmpp
Server: nginx/1.10.3 (Ubuntu)
Date: Thu, 01 Aug 2019 21:42:28 GMT
Content-Type: application/json
Content-Length: 45
Connection: keep-alive
Cache-Control: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT

{"state":"message received!","status":true}

INFO hawkeye Request: DELETE http://40.121.41.66:8080/java/xmpp
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.22.0
Content-Length: 0


INFO hawkeye Response: 200 http://40.121.41.66:8080/java/xmpp
Server: nginx/1.10.3 (Ubuntu)
Date: Thu, 01 Aug 2019 21:42:29 GMT
Content-Length: 0
Connection: keep-alive
Cache-Control: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT


INFO hawkeye Request: GET http://40.121.41.66:8080/java/xmpp
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.22.0


INFO hawkeye Response: 200 http://40.121.41.66:8080/java/xmpp
Server: nginx/1.10.3 (Ubuntu)
Date: Thu, 01 Aug 2019 21:42:29 GMT
Content-Type: application/json
Content-Length: 45
Connection: keep-alive
Cache-Control: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT

{"state":"message received!","status":true}

ERROR hawkeye tests.xmpp_tests.SendAndReceiveTest.runTest - failed with error:
Traceback (most recent call last):
  File "/home/jenkins/jobs/Hawkeye-Test-Azure-Image/workspace/hawkeye/test-suite/hawkeye_test_runner.py", line 410, in runTest
    self.run_hawkeye_test()
  File "/home/jenkins/jobs/Hawkeye-Test-Azure-Image/workspace/hawkeye/test-suite/tests/xmpp_tests.py", line 63, in run_hawkeye_test
    self.assertEquals(xmpp_info['state'], 'non-existent')
AssertionError: u'message received!' != 'non-existent'

For some reason the key doesn't look like it is getting removed from the datastore:

INFO hawkeye Request: DELETE http://40.121.41.66:8080/java/xmpp
INFO hawkeye Response: 200 http://40.121.41.66:8080/java/xmpp
INFO hawkeye Request: GET http://40.121.41.66:8080/java/xmpp
INFO hawkeye Response: 200 http://40.121.41.66:8080/java/xmpp
{"state":"message received!","status":true}

This might be a timing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant