Opened 11 years ago

Closed 9 years ago

#2327 defect closed fixed (fixed)

Intermittent failure in PB tests

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: pb Keywords:
Cc: Branch: branches/test_publishable-win32-2327
branch-diff, diff-cov, branch-cov, buildbot
Author: exarkun

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 (7)

comment:1 Changed 9 years ago by Jean-Paul Calderone

#2879 was a duplicate of this.

comment:2 Changed 9 years ago by Jean-Paul Calderone

author: exarkun
Branch: branches/test_publishable-win32-2327

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

comment:3 Changed 9 years ago by Jean-Paul Calderone

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.

comment:4 Changed 9 years ago by therve

Keywords: review removed
Owner: set to Jean-Paul Calderone

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

comment:5 Changed 9 years ago by Jean-Paul Calderone

(In [24241]) Explicitly close opened files

refs #2327

comment:6 Changed 9 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(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.

comment:7 Changed 7 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.