Random failures on SFTPTransport tests on windows

Bug #681047 reported by Martin Packman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
John A Meinel

Bug Description

A number of SFTP tests have been randomly failing on babune over the past few months. All seem to involve PermissionError being thrown when trying to move a file. This is likely a race condition with the server or client not being careful about closing a shared file before allowing the other to continue.

Tracebacks are along the lines of:

<http://babune.ladeuil.net:24842/job/selftest-windows/224/testReport/junit/bzrlib.tests.per_transport/TransportTests/test_move_SFTPTransport_SFTPHomeDirServer_/>

Traceback (most recent call last):
  ...
  File "...\bzrlib\tests\per_transport.py", line 1001, in test_move
    t.move('c', 'b')
  File "...\bzrlib\transport\sftp.py", line 773, in move
    self._rename_and_overwrite(path_from, path_to)
  File "...\bzrlib\transport\sftp.py", line 767, in _rename_and_overwrite
    ': unable to rename to %r' % (abs_to))
  File "...\bzrlib\transport\sftp.py", line 706, in _translate_io_exception
    self._translate_error(e, path, raise_generic=False)
  File "...\bzrlib\transport\__init__.py", line 316, in _translate_error
    raise errors.PermissionDenied(path, extra=e)
PermissionDenied: Permission denied: "c": [Errno 13] Permission denied

<http://babune.ladeuil.net:24842/job/selftest-windows/224/testReport/bzrlib.tests.per_transport/TransportTests/test_put_file_SFTPTransport_SFTPSiblingAbsoluteServer_/>

Traceback (most recent call last):
  ...
  File "...\bzrlib\tests\per_transport.py", line 403, in test_put_file
    result = t.put_file('a', StringIO('new\ncontents for\na\n'))
  File "...\bzrlib\transport\sftp.py", line 495, in put_file
    return self._put(final_path, f, mode=mode)
  File "...\bzrlib\transport\sftp.py", line 526, in _put
    self._rename_and_overwrite(tmp_abspath, abspath)
  File "...\bzrlib\transport\sftp.py", line 767, in _rename_and_overwrite
    ': unable to rename to %r' % (abs_to))
  File "...\bzrlib\transport\sftp.py", line 706, in _translate_io_exception
    self._translate_error(e, path, raise_generic=False)
  File "...\bzrlib\transport\__init__.py", line 316, in _translate_error
    raise errors.PermissionDenied(path, extra=e)
PermissionDenied: Permission denied: "/C:/windows/temp/testbzr-fqqbul.tmp/ort_SFTPSiblingAbsoluteServer)/work/a.tmp.1289089305.118000000.384.399958340": [Errno 13] Permission denied

Related branches

Martin Packman (gz)
Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

There is a quite suspicious:

class TransportTests(TestTransportImplementation):

    def setUp(self):
        super(TransportTests, self).setUp()
        self._captureVar('BZR_NO_SMART_VFS', None)

    def check_transport_contents(self, content, transport, relpath):
        """Check that transport.get(relpath).read() == content."""
        self.assertEqualDiff(content, transport.get(relpath).read())

We'd better use get_bytes() there instead of get()...

John A Meinel (jameinel)
Changed in bzr:
status: Confirmed → In Progress
assignee: nobody → John A Meinel (jameinel)
John A Meinel (jameinel)
Changed in bzr:
status: In Progress → Fix Released
milestone: none → 2.3b5
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.