Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 776352

Summary: dev-util/pkgcheck-0.9.3: fails test (TestEclassAddon::test_eclass_changes: AssertionError: Expected 'save_cache' to have been called once. Called 0 times)
Product: Gentoo Linux Reporter: Sam James <sam>
Component: Current packagesAssignee: Michał Górny <mgorny>
Status: RESOLVED OBSOLETE    
Severity: normal Keywords: TESTFAILURE
Priority: Normal    
Version: unspecified   
Hardware: s390   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
build.log (9999)

Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-15 12:29:42 UTC
Created attachment 691575 [details]
build.log

========================================================================= FAILURES ==========================================================================
____________________________________________________________ TestEclassAddon.test_eclass_changes ____________________________________________________________

self = <tests.addons.test_eclass.TestEclassAddon object at 0x7a7a1268>

    def test_eclass_changes(self):
        """The cache stores eclass mtimes and regenerates entries if they differ."""
        eclass_path = pjoin(self.eclass_dir, 'foo.eclass')
        touch(eclass_path)
        self.addon.update_cache()
        assert list(self.addon.eclasses) == ['foo']
        with open(eclass_path, 'w') as f:
            f.write('# changed eclass
')
        with patch('pkgcheck.addons.caches.CachedAddon.save_cache') as save_cache:
            self.addon.update_cache()
>           save_cache.assert_called_once()

tests/addons/test_eclass.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <MagicMock name='save_cache' id='2054411744'>

    def assert_called_once(self):
        """assert that the mock was called only once.
        """
        if not self.call_count == 1:
            msg = ("Expected '%s' to have been called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'save_cache' to have been called once. Called 0 times.

/usr/lib/python3.8/unittest/mock.py:892: AssertionError
------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------
ERROR pkgcore: '@ECLASS:' block missing
ERROR pkgcore: '@ECLASS:' block missing
ERROR pkgcore: '@ECLASS:' block missing
ERROR pkgcore: '@ECLASS:' block missing
ERROR pkgcore: '@ECLASS:' block missing
ERROR pkgcore: '@ECLASS:' block missing
ERROR pkgcore: '@ECLASS:' block missing
--------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------
ERROR    pkgcore:eclass.py:449 '@ECLASS:' block missing
================================================================== short test summary info ==================================================================
FAILED tests/addons/test_eclass.py::TestEclassAddon::test_eclass_changes - AssertionError: Expected 'save_cache' to have been called once. Called 0 times.
=================================================== 1 failed, 676 passed, 61 skipped in 102.31s (0:01:42) ===================================================

----

# emerge -pvO pkgcheck pkgcore snakeoil

These are the packages that would be merged, in order:

[ebuild   R   *] dev-util/pkgcheck-0.9.3::gentoo  USE="-test" PYTHON_TARGETS="python3_8 python3_9" 0 KiB
[ebuild   R    ] sys-apps/pkgcore-0.11.5-r1::gentoo  USE="-test" PYTHON_TARGETS="python3_8 python3_9" 0 KiB
[ebuild   R    ] dev-python/snakeoil-0.9.4::gentoo  USE="-test" PYTHON_TARGETS="python3_8 python3_9" 0 KiB

Total: 3 packages (3 reinstalls), Size of downloads: 0 KiB

----
Portage 3.0.17 (python 3.9.2-final-0, default/linux/s390/17.0, gcc-10.2.0, glibc-2.32-r8, 5.10.7 s390)
=================================================================
System uname: Linux-5.10.7-s390-8561-with-glibc2.32
KiB Mem:     2055988 total,    616080 free
KiB Swap:      99160 total,     53660 free
Timestamp of repository gentoo: Mon, 15 Mar 2021 10:53:06 +0000
sh bash 5.1_p4
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p4::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          3.8.8::gentoo, 3.9.2::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.21::gentoo
sys-devel/autoconf:       2.71::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.11::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r8::gentoo
Repositories:

gentoo
    location: /bound/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="s390 ~s390"
ACCEPT_LICENSE="*"
CBUILD="s390-ibm-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fdiagnostics-show-option -frecord-gcc-switches"
CHOST="s390-ibm-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/bound/distfiles"
EMERGE_DEFAULT_OPTS=" --complete-graph --keep-going --with-bdeps=y --deep --with-bdeps=y --complete-graph --deep --keep-going"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j3 -l3"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl berkdb big-endian bzip2 cli crypt dbus dri elogind fortran gdbm iconv ipv6 ncurses nls nptl openmp pam pcre readline s390 seccomp split-usr ssl tcpd unicode xattr zlib" ABI_S390="32" ADA_TARGET="gnat_2018" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="void libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-15 12:30:21 UTC
I've only reproduced this on s390 and s390x so far. Everything is up to date, depclean didn't help. Tried current stable candidates which failed in the same way.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-15 12:35:17 UTC
Created attachment 691581 [details]
build.log (9999)

9999 failures:

FAILED tests/addons/test_eclass.py::TestEclassAddon::test_eclass_changes - AssertionError: Expected 'save_cache' to have been called once. Called 0 times.
FAILED tests/scripts/test_pkgcheck_scan.py::TestPkgcheckScan::test_scan_verify[eclass] - Failed: unmatched repo scan results:
=================================================== 2 failed, 675 passed, 61 skipped in 102.30s (0:01:42) ===================================================
 * ERROR: dev-util/pkgcheck-9999::gentoo failed (test phase):
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-15 12:38:56 UTC
The same failure exists in 0.7.9-r2 which is the last keyworded version for ~s390:

========================================================================== short test summary info ===========================================================================
FAILED tests/module/test_eclass.py::TestEclassAddon::test_eclass_changes - AssertionError: Expected 'save_cache' to have been called once. Called 0 times.
FAILED tests/module/checks/test_git.py::TestGitPkgCommitsCheck::test_direct_stable - AssertionError: expected one report, got 2: [<pkgcheck.checks.git.EbuildIncorrectCopyr...
FAILED tests/module/checks/test_git.py::TestGitPkgCommitsCheck::test_direct_no_maintainer - AssertionError: expected one report, got 2: [<pkgcheck.checks.git.EbuildIncorre...
FAILED tests/module/checks/test_git.py::TestGitPkgCommitsCheck::test_rdepend_change - AssertionError: expected one report, got 3: [<pkgcheck.checks.git.RdependChange objec...
FAILED tests/module/checks/test_git.py::TestGitPkgCommitsCheck::test_missing_slotmove - AssertionError: expected one report, got 2: [<pkgcheck.checks.git.MissingSlotmove o...
FAILED tests/module/checks/test_git.py::TestGitPkgCommitsCheck::test_missing_move - AssertionError: expected one report, got 2: [<pkgcheck.checks.git.MissingMove object at...
============================================================ 6 failed, 676 passed, 60 skipped in 83.72s (0:01:23) ============================================================
 * ERROR: dev-util/pkgcheck-0.7.9-r2::gentoo failed (test phase):
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-03-15 12:47:08 UTC
Honestly, I can't imagine why something would be broken only on s390.  Maybe check if some deps aren't pending rekeywording and you've got ancient versions installed?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-15 13:36:03 UTC
(In reply to Michał Górny from comment #4)
> Honestly, I can't imagine why something would be broken only on s390.  Maybe
> check if some deps aren't pending rekeywording and you've got ancient
> versions installed?

I think you've got to be right - I've checked and somehow it passes on s390x now, but not s390. It must be something lingering.
 
I'll keep this open for a little bit in case I realise what it is though.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-29 11:21:17 UTC
I don't think I've seen this since.