Comment 1 for bug 1856240

Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

The exception in the report is coming from stestr while receiving the attachments from the subunit test executor. Plus pprint.pformat guaranteed to return an unicode string based on the python doc [1].

So I think this is not the nova test code that emits a non text output but the subunit / stestr interaction converts such output to a byte array (hence the b' in your console) and most probably that byte array is split during transport between subunit and stestr. Then on the stestr side one piece of the split byte array is converted back to text. If the split happen at a byte position that is not an end of an unicode character then the byte array -> text conversion fails and the attachment type is set to octet stream as a fallback.

I think this is related to bug 1813147[2] for which we have a potential fix proposed in stestr [2].

I think we should wait for [2] to be fixed instead of removing reasonable output from our test. I understand that if there is less test output then there is less chance to hit the stestr bug but the proposed solution to remove the pprint.pformat did not reduce the test output significantly (it only adds newlines and spaces /tabs ).

[1] https://docs.python.org/3/library/pprint.html#pprint.pformat
[2] https://bugs.launchpad.net/nova/+bug/1813147/comments/62