Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 656440 - dev-python/flexmock-0.10.2 : [TEST] E flexmock.CallOrderError: bar() called before bar( b )
Summary: dev-python/flexmock-0.10.2 : [TEST] E flexmock.CallOrderError: bar() called b...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Nelo-T. Wallus (ntnn)
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2018-05-24 17:14 UTC by Toralf Förster
Modified: 2018-06-10 19:49 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,17.97 KB, text/plain)
2018-05-24 17:14 UTC, Toralf Förster
Details
dev-python:flexmock-0.10.2:20180524-112409.log (dev-python:flexmock-0.10.2:20180524-112409.log,156.96 KB, text/plain)
2018-05-24 17:14 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,344.97 KB, text/plain)
2018-05-24 17:14 UTC, Toralf Förster
Details
environment (environment,105.27 KB, text/plain)
2018-05-24 17:14 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,24.77 KB, application/x-bzip)
2018-05-24 17:15 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,32.29 KB, application/x-bzip)
2018-05-24 17:15 UTC, Toralf Förster
Details
tests.tbz2 (tests.tbz2,9.16 KB, application/x-bzip)
2018-05-24 17:15 UTC, Toralf Förster
Details
emerge-info.txt (emerge-info.txt,19.36 KB, text/plain)
2018-06-06 20:43 UTC, Toralf Förster
Details
dev-python:flexmock-0.10.2:20180606-203753.log (dev-python:flexmock-0.10.2:20180606-203753.log,5.28 KB, text/plain)
2018-06-06 20:43 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,586.52 KB, text/plain)
2018-06-06 20:43 UTC, Toralf Förster
Details
environment (environment,106.97 KB, text/plain)
2018-06-06 20:43 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,31.58 KB, application/x-bzip)
2018-06-06 20:43 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,24.95 KB, application/x-bzip)
2018-06-06 20:43 UTC, Toralf Förster
Details
tests.tbz2 (tests.tbz2,9.16 KB, application/x-bzip)
2018-06-06 20:43 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2018-05-24 17:14:45 UTC
                (_format_args(expectation.name, args),
>                _format_args(next_method.name, next_method.args)))
E           flexmock.CallOrderError: bar() called before bar("b")

../flexmock-0.10.2-python3_5/lib/flexmock.py:149: CallOrderError
 TestRegularClass.test_flexmock_ordered_works_with_same_args_after_default_stub 

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0-hardened_test_20180512-194415

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.3.0 *

Available Python interpreters, in order of preference:
  [1]   python3.5
  [2]   python3.6 (fallback)
  [3]   python2.7 (fallback)
  [4]   pypy3 (fallback)
  [5]   pypy (fallback)

java-config:
The following VMs are available for generation-2:


emerge -qpv dev-python/flexmock
[ebuild  N    ] dev-python/flexmock-0.10.2  USE="{test}" PYTHON_TARGETS="python3_5 -python3_4 -python3_6" 

!!! The following installed packages are masked:
- sys-apps/baselayout-2.5::gentoo (masked by: package.mask)
/usr/portage/profiles/package.mask:
# William Hubbs <williamh@gentoo.org> (22 May 2018)
# Installs spurious paths  ,see bug #656380

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.
Comment 1 Toralf Förster gentoo-dev 2018-05-24 17:14:48 UTC
Created attachment 532986 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2018-05-24 17:14:51 UTC
Created attachment 532988 [details]
dev-python:flexmock-0.10.2:20180524-112409.log
Comment 3 Toralf Förster gentoo-dev 2018-05-24 17:14:54 UTC
Created attachment 532990 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2018-05-24 17:14:57 UTC
Created attachment 532992 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2018-05-24 17:15:00 UTC
Created attachment 532994 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2018-05-24 17:15:03 UTC
Created attachment 532996 [details]
temp.tbz2
Comment 7 Toralf Förster gentoo-dev 2018-05-24 17:15:06 UTC
Created attachment 532998 [details]
tests.tbz2
Comment 8 Nelo-T. Wallus (ntnn) 2018-06-06 19:59:37 UTC
The issue seems to have appeared before and is caused by teardown methods not being executed: https://github.com/has207/flexmock/issues/98
The patch of the referring PR is still in place.

Looking at the existing tests and logs that explanation matches, so it could be a  change in how pytest handles teardowns or a new regression in pytest. 

I can't reproduce the issue with the same python and pytest versions though. Could you execute the tests again to see if its an intermittent or random error? Thanks.
Comment 9 Toralf Förster gentoo-dev 2018-06-06 20:42:57 UTC
run it again at that image but got now a different error - see attached files
Comment 10 Toralf Förster gentoo-dev 2018-06-06 20:43:00 UTC
Created attachment 535142 [details]
emerge-info.txt
Comment 11 Toralf Förster gentoo-dev 2018-06-06 20:43:03 UTC
Created attachment 535144 [details]
dev-python:flexmock-0.10.2:20180606-203753.log
Comment 12 Toralf Förster gentoo-dev 2018-06-06 20:43:06 UTC
Created attachment 535146 [details]
emerge-history.txt
Comment 13 Toralf Förster gentoo-dev 2018-06-06 20:43:09 UTC
Created attachment 535148 [details]
environment
Comment 14 Toralf Förster gentoo-dev 2018-06-06 20:43:12 UTC
Created attachment 535150 [details]
etc.portage.tbz2
Comment 15 Toralf Förster gentoo-dev 2018-06-06 20:43:15 UTC
Created attachment 535152 [details]
temp.tbz2
Comment 16 Toralf Förster gentoo-dev 2018-06-06 20:43:17 UTC
Created attachment 535154 [details]
tests.tbz2
Comment 17 Nelo-T. Wallus (ntnn) 2018-06-06 20:51:38 UTC
Thanks. That seems to be a problem with pytests' plugin system. I'll see if I can reproduce that in a clean jail.
Comment 18 Toralf Förster gentoo-dev 2018-06-06 20:57:34 UTC
(In reply to Nelo-T. Wallus (ntnn) from comment #17)
would be great b/c this _pluggy happens often here at the tinderbox at various images
Comment 19 Nelo-T. Wallus (ntnn) 2018-06-06 22:12:57 UTC
Seems to be a bug caused by dev-python/pytest-metadata: https://github.com/pytest-dev/pytest/issues/2960
The original repository has been deleted, so the RCA can't be followed.

The project has been forked to https://github.com/davehunt/pytest-metadata/, which is used as upstream for the gentoo package. We're also lagging a few minors behind, though the fork hasn't seen any work in a few months.

There are no packages depending on pytest-metadata. I'll post a PR to bump the package to the newest version - hopefully that fixes the problem.
Comment 20 Nelo-T. Wallus (ntnn) 2018-06-07 05:52:41 UTC
Okay, the repository has not been deleted - the link was just broken.

Here is the RCA issue: https://github.com/pytest-dev/pytest-metadata/issues/5

The fix has been included in 1.5.1, current is 1.7.0. I'll send in the PR for that version.
Comment 21 Nelo-T. Wallus (ntnn) 2018-06-07 06:01:16 UTC
PR: https://github.com/gentoo/gentoo/pull/8742
Comment 22 Nelo-T. Wallus (ntnn) 2018-06-07 11:05:23 UTC
Toralf, the PR was just merged. Do you want to update and rerun the tests immediately or wait for the automated tests?
Comment 23 Toralf Förster gentoo-dev 2018-06-07 17:30:42 UTC
(In reply to Nelo-T. Wallus (ntnn) from comment #22)
rerun it at the same image and got :

tests/flexmock_test.py:1388: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../flexmock-0.10.2-python3_5/lib/flexmock.py:945: in mock_method
    self, name, arguments)
../flexmock-0.10.2-python3_5/lib/flexmock.py:135: in get_flexmock_expectation
    cls._verify_call_order(found, args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'flexmock.FlexmockContainer'>
expectation = <flexmock.Expectation object at 0x7f973f3de748>
args = {'kargs': (), 'kwargs': {}}

    @classmethod
    def _verify_call_order(cls, expectation, args):
        if not cls.ordered:
            next_method = cls.last
        else:
            next_method = cls.ordered.pop(0)
            cls.last = next_method
        if expectation is not next_method:
            raise CallOrderError(
                '%s called before %s' %
                (_format_args(expectation.name, args),
>                _format_args(next_method.name, next_method.args)))
E           flexmock.CallOrderError: bar() called before bar("b")

../flexmock-0.10.2-python3_5/lib/flexmock.py:149: CallOrderError
=============================== warnings summary ===============================
None
  pytest-catchlog plugin has been merged into the core, please remove it from your requirements.

tests/flexmock_nose_test.py::test_module_level_generator
  yield tests are deprecated, and scheduled to be removed in pytest 4.0

tests/flexmock_nose_test.py::TestRegularClass::()::test_class_level_generator_tests
  yield tests are deprecated, and scheduled to be removed in pytest 4.0

-- Docs: http://doc.pytest.org/en/latest/warnings.html
======== 12 failed, 1003 passed, 1 xfailed, 3 warnings in 12.40 seconds ========
 * ERROR: dev-python/flexmock-0.10.2::gentoo failed (test phase):





but maybe that image (it has now 10,000 packages and is at his life end) is broken ?
Comment 24 Nelo-T. Wallus (ntnn) 2018-06-07 19:23:23 UTC
Might be, but it'd still be strange. We'll keep this open, if this doesn't hit in a new tinderbox and/or if I can\t replicate it can still be closed.

Thanks.
Comment 25 Nelo-T. Wallus (ntnn) 2018-06-10 19:49:02 UTC
I've tried to replicate this in a clean chroot, but I'm unable to replicate the error.

I'll close this for now, if the issue occurs again I'll follow up on it further.