Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI admin-test flakes #3814

Closed
heartsucker opened this issue Sep 11, 2018 · 1 comment
Closed

CI admin-test flakes #3814

heartsucker opened this issue Sep 11, 2018 · 1 comment

Comments

@heartsucker
Copy link
Contributor

Description

==================================== ERRORS ====================================
______________ ERROR at teardown of TestGitOperations.test_update ______________

tmpdir = local('/tmp/pytest-of-root/pytest-0/test_update0')

    @pytest.fixture
    def securedrop_git_repo(tmpdir):
        os.chdir(str(tmpdir))
        # Clone the SecureDrop repository into the temp directory.
        cmd = ['git', 'clone',
               'https://github.com/freedomofpress/securedrop.git']
        subprocess.check_call(cmd)
        os.chdir(os.path.join(str(tmpdir), 'securedrop/admin'))
        subprocess.check_call('git reset --hard'.split())
        # Now we will put in our own git configuration
        with io.open('../.git/config', 'w') as fobj:
            fobj.write(GIT_CONFIG)
        # Let us move to an older tag
        subprocess.check_call('git checkout 0.6'.split())
        yield tmpdir
    
        # Save coverage information in same directory as unit test coverage
        test_name = str(tmpdir).split('/')[-1]
        subprocess.check_call(['cp',
                               '{}/securedrop/admin/.coverage'.format(
                                   str(tmpdir)),
                               '{}/../.coverage.{}'.format(CURRENT_DIR,
>                                                          test_name)])

/opt/tests/test_integration.py:475: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

popenargs = (['cp', '/tmp/pytest-of-root/pytest-0/test_update0/securedrop/admin/.coverage', '/opt/tests/../.coverage.test_update0'],)
kwargs = {}, retcode = 1
cmd = ['cp', '/tmp/pytest-of-root/pytest-0/test_update0/securedrop/admin/.coverage', '/opt/tests/../.coverage.test_update0']

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.
    
        The arguments are the same as for the Popen constructor.  Example:
    
        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           CalledProcessError: Command '['cp', '/tmp/pytest-of-root/pytest-0/test_update0/securedrop/admin/.coverage', '/opt/tests/../.coverage.test_update0']' returned non-zero exit status 1

/usr/lib/python2.7/subprocess.py:186: CalledProcessError
---------------------------- Captured stdout setup -----------------------------
HEAD is now at 22edeb66 Merge pull request #3803 from freedomofpress/ci-flaky-updater-gui
---------------------------- Captured stderr setup -----------------------------
Cloning into 'securedrop'...
Note: checking out '0.6'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 4cbab07f... SecureDrop 0.6
--------------------------- Captured stderr teardown ---------------------------
cp: cannot stat '/tmp/pytest-of-root/pytest-0/test_update0/securedrop/admin/.coverage': No such file or directory
=================================== FAILURES ===================================
________________________ TestGitOperations.test_update _________________________

self = <test_integration.TestGitOperations instance at 0x7f42b54850e0>
securedrop_git_repo = local('/tmp/pytest-of-root/pytest-0/test_update0')

    def test_update(self, securedrop_git_repo):
        gpgdir = os.path.join(os.path.expanduser('~'), '.gnupg')
        set_reliable_keyserver(gpgdir)
    
        cmd = os.path.join(os.path.dirname(CURRENT_DIR),
                           'securedrop_admin/__init__.py')
        ansible_base = os.path.join(str(securedrop_git_repo),
                                    'securedrop/install_files/ansible-base')
        child = pexpect.spawn('coverage run {0} --root {1} update'.format(
                              cmd, ansible_base))
    
>       output = child.read()

/opt/tests/test_integration.py:542: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/.tox/py2/local/lib/python2.7/site-packages/pexpect/spawnbase.py:441: in read
    self.expect(self.delimiter)
/opt/.tox/py2/local/lib/python2.7/site-packages/pexpect/spawnbase.py:341: in expect
    timeout, searchwindowsize, async_)
/opt/.tox/py2/local/lib/python2.7/site-packages/pexpect/spawnbase.py:369: in expect_list
    return exp.expect_loop(timeout)
/opt/.tox/py2/local/lib/python2.7/site-packages/pexpect/expect.py:119: in expect_loop
    return self.timeout(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pexpect.expect.Expecter object at 0x7f42b5469910>
err = TIMEOUT('Timeout exceeded.',)

    def timeout(self, err=None):
        spawn = self.spawn
    
        spawn.before = spawn.buffer
        spawn.after = TIMEOUT
        index = self.searcher.timeout_index
        if index >= 0:
            spawn.match = TIMEOUT
            spawn.match_index = index
            return index
        else:
            spawn.match = None
            spawn.match_index = None
            msg = str(spawn)
            msg += '\nsearcher: %s' % self.searcher
            if err is not None:
                msg = str(err) + '\n' + msg
>           raise TIMEOUT(msg)
E           TIMEOUT: Timeout exceeded.
E           <pexpect.pty_spawn.spawn object at 0x7f42b5469810>
E           command: /opt/.tox/py2/bin/coverage
E           args: ['/opt/.tox/py2/bin/coverage', 'run', '/opt/securedrop_admin/__init__.py', '--root', '/tmp/pytest-of-root/pytest-0/test_update0/securedrop/install_files/ansible-base', 'update']
E           buffer (last 100 chars): "ded\r\nINFO: Verifying signature on latest update...\r\ngpg: keybox '/root/.gnupg/pubring.kbx' created\r\n"
E           before (last 100 chars): "ded\r\nINFO: Verifying signature on latest update...\r\ngpg: keybox '/root/.gnupg/pubring.kbx' created\r\n"
E           after: <class 'pexpect.exceptions.TIMEOUT'>
E           match: None
E           match_index: None
E           exitstatus: None
E           flag_eof: False
E           pid: 481
E           child_fd: 14
E           closed: False
E           timeout: 30
E           delimiter: <class 'pexpect.exceptions.EOF'>
E           logfile: None
E           logfile_read: None
E           logfile_send: None
E           maxread: 2000
E           ignorecase: False
E           searchwindowsize: None
E           delaybeforesend: 0.05
E           delayafterclose: 0.1
E           delayafterterminate: 0.1
E           searcher: searcher_re:
E               0: EOF

/opt/.tox/py2/local/lib/python2.7/site-packages/pexpect/expect.py:82: TIMEOUT
---------------------------- Captured stdout setup -----------------------------
HEAD is now at 22edeb66 Merge pull request #3803 from freedomofpress/ci-flaky-updater-gui
---------------------------- Captured stderr setup -----------------------------
Cloning into 'securedrop'...
Note: checking out '0.6'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 4cbab07f... SecureDrop 0.6
================ 1 failed, 64 passed, 1 error in 84.24 seconds =================
ERROR: InvocationError: '/usr/bin/env /opt/.tox/py2/bin/coverage run --source=securedrop_admin,bootstrap /opt/.tox/py2/bin/py.test -v tests'
___________________________________ summary ____________________________________
  pylint: commands succeeded
  flake8: commands succeeded
ERROR:   py2: commands failed
Makefile:5: recipe for target 'test' failed
make: *** [test] Error 1
Exited with code 2

Steps to Reproduce

Unsure. It's in CI.

Expected Behavior

CI passes.

Actual Behavior

It doesn't.

Comments

I've seen this a couple of times.

@redshiftzero
Copy link
Contributor

dupe of #3553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants