Ticket #2327 defect closed fixed

Opened 7 years ago

Last modified 6 years ago

Intermittent failure in PB tests

Reported by: exarkun Owned by:
Priority: normal Milestone:
Component: pb Keywords:
Cc: Branch: branches/test_publishable-win32-2327
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:

Description

===============================================================================
[ERROR]: twisted.test.test_pb.BrokerTestCase.testPublishable

Traceback (most recent call last):
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\test\test_pb.py", line 651, in testPublishable
    pump.flush()
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\test\test_pb.py", line 71, in flush
    while self.pump():
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\test\test_pb.py", line 93, in pump
    self.client.dataReceived(byte)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\banana.py", line 218, in dataReceived
    gotItem(item)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\banana.py", line 148, in gotItem
    self.callExpressionReceived(item)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\banana.py", line 113, in callExpressionReceived
    self.expressionReceived(obj)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\pb.py", line 523, in expressionReceived
    method(*sexp[1:])
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\pb.py", line 892, in proto_answer
    d.callback(self.unserialize(netResult))
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\pb.py", line 784, in unserialize
    return unjelly(sexp, self.security, None, self)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\jelly.py", line 900, in unjelly
    return _Unjellier(taster, persistentLoad, invoker).unjellyFull(sexp)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\jelly.py", line 523, in unjellyFull
    o = self.unjelly(obj)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\jelly.py", line 546, in unjelly
    val = method(self, obj)
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\flavors.py", line 458, in unjellyFor
    cProxy.setCopyableState(unjellier.unjelly(jellyList[2]))
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\publish.py", line 86, in setCopyableState
    newself = jelly.unjelly(banana.decode(data))
  File "c:\twistedbuildbot\W32-full2.4-scmikes-select\Twisted\twisted\spread\banana.py", line 349, in decode
    return l[0]
exceptions.IndexError: list index out of range
-------------------------------------------------------------------------------

I expect this is a test bug related to the mock transport implemented and used by these tests, rather than a bug in PB itself.

Change History

1

Changed 6 years ago by exarkun

#2879 was a duplicate of this.

2

Changed 6 years ago by exarkun

  • branch set to branches/test_publishable-win32-2327
  • author set to exarkun

(In [24177]) Branching to 'test_publishable-win32-2327'

3

Changed 6 years ago by exarkun

  • keywords review added
  • owner warner deleted

I don't know how this test could have ever passed. It wrote banana data, including \x1a (aka EOF on Windows) to a binary file. Later, it tried to read it back from a text file, resulting in truncated data. Should have always failed.

4

Changed 6 years ago by therve

  • owner set to exarkun
  • keywords review removed

It looks good. It would be nice though if the file were explicitly closed (same thing in _cbGotUpdate). But please merge when you want.

5

Changed 6 years ago by exarkun

(In [24241]) Explicitly close opened files

refs #2327

6

Changed 6 years ago by exarkun

  • status changed from new to closed
  • resolution set to fixed

(In [24244]) Merge test_publishable-win32-2327

Author: exarkun Reviewer: therve Fixes: #2327

Read publishable data files in binary mode so that the data is not corrupted on Windows. Also, explicitly close the files rather than relying on refcounting to do it.

7

Changed 3 years ago by <automation>

  • owner exarkun deleted
Note: See TracTickets for help on using tickets.