Opened 7 years ago

Closed 7 years ago

#2621 closed defect (fixed)

python3.3 and failed session_test.py tests

Reported by: jreed Owned by: jelte
Priority: medium Milestone: Sprint-20130205
Component: tests Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 2 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

This is with python 3.3.0. I didn't see this with python 3.2.3.

Running test: session_test.py
..FFFF........
======================================================================
FAIL: test_group_reply (__main__.testSession)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/b10builder/builder/work/BIND10-valgrind/20130109095003-CentOS5-x86_64-GCC/build/src/lib/python/isc/cc/tests/session_test.py", line 382, in test_group_reply
    self.assertEqual(sent, b'\x00\x00\x00\x8b\x00{{"from": "test_name", "seq": 2, "to": "me", "instance": "other_instance", "reply": 4, "group": "our_group", "type": "send"}{"hello": "a"}')
AssertionError: bytearray(b'\x00\x00\x00\x8b\x00{{"group": "our_group", "seq": 2, "to": "me", "type": "send", "from": "test_name", "instance": "other_instance", "reply": 4}{"hello": "a"}') != b'\x00\x00\x00\x8b\x00{{"from": "test_name", "seq": 2, "to": "me", "instance": "other_instance", "reply": 4, "group": "our_group", "type": "send"}{"hello": "a"}'

======================================================================
FAIL: test_group_sendmsg (__main__.testSession)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/b10builder/builder/work/BIND10-valgrind/20130109095003-CentOS5-x86_64-GCC/build/src/lib/python/isc/cc/tests/session_test.py", line 360, in test_group_sendmsg
    self.assertEqual(sent, b'\x00\x00\x00p\x00`{"from": "test_name", "seq": 2, "to": "*", "instance": "*", "group": "my_group", "type": "send"}{"hello": "a"}')
AssertionError: bytearray(b'\x00\x00\x00p\x00`{"group": "my_group", "seq": 2, "to": "*", "type": "send", "from": "test_name", "instance": "*"}{"hello": "a"}') != b'\x00\x00\x00p\x00`{"from": "test_name", "seq": 2, "to": "*", "instance": "*", "group": "my_group", "type": "send"}{"hello": "a"}'

======================================================================
FAIL: test_group_subscribe (__main__.testSession)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/b10builder/builder/work/BIND10-valgrind/20130109095003-CentOS5-x86_64-GCC/build/src/lib/python/isc/cc/tests/session_test.py", line 330, in test_group_subscribe
    self.assertEqual(sent, b'\x00\x00\x00<\x00:{"group": "mygroup", "type": "subscribe", "instance": "*"}')
AssertionError: bytearray(b'\x00\x00\x00<\x00:{"type": "subscribe", "group": "mygroup", "instance": "*"}') != b'\x00\x00\x00<\x00:{"group": "mygroup", "type": "subscribe", "instance": "*"}'

======================================================================
FAIL: test_group_unsubscribe (__main__.testSession)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/b10builder/builder/work/BIND10-valgrind/20130109095003-CentOS5-x86_64-GCC/build/src/lib/python/isc/cc/tests/session_test.py", line 344, in test_group_unsubscribe
    self.assertEqual(sent, b'\x00\x00\x00>\x00<{"group": "mygroup", "type": "unsubscribe", "instance": "*"}')
AssertionError: bytearray(b'\x00\x00\x00>\x00<{"type": "unsubscribe", "group": "mygroup", "instance": "*"}') != b'\x00\x00\x00>\x00<{"group": "mygroup", "type": "unsubscribe", "instance": "*"}'

----------------------------------------------------------------------
Ran 14 tests in 0.127s

FAILED (failures=4)
make[7]: *** [check-local] Error 1

This is on a CentOS 5.8 Linux system.

Subtickets

Attachments (1)

bind10_python3.3_sessiontest.patch (10.6 KB) - added by jelte 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by jwright

  • Component changed from Unclassified to tests
  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:2 Changed 7 years ago by jelte

Looks like we can no longer misuse the accidental fixed ordering of dicts :)

I propose to actually parse the full message and just check the two dicts it contains, see attachment for a proposed patch.

Changed 7 years ago by jelte

comment:3 Changed 7 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20130205

comment:4 Changed 7 years ago by muks

  • Owner set to UnAssigned
  • Status changed from new to reviewing

This ticket's patch also has to be reviewed next. Please assign it back to Jelte when you have done the review.

comment:5 Changed 7 years ago by muks

  • Owner changed from UnAssigned to jelte

This patch looks good to me, and it passes make check here.

But you may want to remove parse_sentmsg() as it's unused and readsentmsg_parsed() does everything required. Even if you decide to remove it, you can go ahead and merge without another review.

comment:6 Changed 7 years ago by jelte

  • Resolution set to fixed
  • Status changed from reviewing to closed

thanks! removed parse_sentmsg() and merged. closing ticket.

Note: See TracTickets for help on using tickets.