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

test failure with 1.3 #156

Closed
ZeroChaos- opened this issue Jan 9, 2020 · 10 comments
Closed

test failure with 1.3 #156

ZeroChaos- opened this issue Jan 9, 2020 · 10 comments
Labels

Comments

@ZeroChaos-
Copy link

I was testing this for inclusion in gentoo and found the tests failing. Please advise.

Thanks!

make -j1 earlyoom 
cc -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Os -march=native -mtune=native -pipe -frecord-gcc-switches -Wall -Wextra -DVERSION=\""(unknown version)"\" -g -fstack-protector-all -std=gnu99 -o earlyoom meminfo.c kill.c msg.c globals.c main.c sanitize.c
>>> Source compiled.
>>> Test phase: sys-apps/earlyoom-1.3
make -j1   test
cd tests ; go test -v
=== RUN   TestCli
--- FAIL: TestCli (1.83s)
    cli_test.go:117: Testcase #0: earlyoom -h
    cli_test.go:117: Testcase #1: earlyoom --help
    cli_test.go:117: Testcase #2: earlyoom 
    cli_test.go:117: Testcase #3: earlyoom -p
    cli_test.go:117: Testcase #4: earlyoom -v
    cli_test.go:137: stderr should contain "earlyoom v", but does not
    cli_test.go:148: stderr:
        earlyoom (unknown version)
    cli_test.go:149: stdout:
        (empty)
    cli_test.go:117: Testcase #5: earlyoom -d
    cli_test.go:129: stdout should contain "^ new victim (higher badness)", but does not
    cli_test.go:148: stderr:
        earlyoom (unknown version)
        mem total: 31812 MiB, swap total: 37278 MiB
        sending SIGTERM when mem <= 10 % and swap <= 10 %,
                SIGKILL when mem <=  5 % and swap <=  5 %
        Could not lock memory - continuing anyway: Cannot allocate memory
    cli_test.go:149: stdout:
        dry-running kill_largest_process()...
        pid     4: badness   0 vm_rss   1704 sandbox
            ^ new victim (higher vm_rss)
        pid     5: badness   0 vm_rss   6532 ebuild.sh
            ^ new victim (higher vm_rss)
        pid    22: badness   0 vm_rss   5684 ebuild.sh
        pid    41: badness   0 vm_rss   2816 make
        pid    45: badness   0 vm_rss   3692 sh
        pid    46: badness   0 vm_rss  17224 go
            ^ new victim (higher vm_rss)
        pid   682: badness   0 vm_rss   4744 tests.test
        pid   695: badness   0 vm_rss   2088 earlyoom
        selecting victim took 0.832 ms
        mem avail: 22746 of 31812 MiB (71 %), swap free: 36742 of 37278 MiB (98 %)
        adaptive sleep time: 1000 ms
    cli_test.go:117: Testcase #6: earlyoom -m 1
    cli_test.go:117: Testcase #7: earlyoom -m 0
    cli_test.go:117: Testcase #8: earlyoom -m -10
    cli_test.go:117: Testcase #9: earlyoom -m 100
    cli_test.go:117: Testcase #10: earlyoom -s 2
    cli_test.go:117: Testcase #11: earlyoom -s 100
    cli_test.go:117: Testcase #12: earlyoom -s 101
    cli_test.go:117: Testcase #13: earlyoom -s 0
    cli_test.go:117: Testcase #14: earlyoom -s -10
    cli_test.go:117: Testcase #15: earlyoom -M 645064
    cli_test.go:117: Testcase #16: earlyoom -M 9999999999999999
    cli_test.go:117: Testcase #17: earlyoom -r 0
    cli_test.go:117: Testcase #18: earlyoom -r 0.1
    cli_test.go:117: Testcase #19: earlyoom --avoid MyProcess1
    cli_test.go:117: Testcase #20: earlyoom --prefer MyProcess2
    cli_test.go:117: Testcase #21: earlyoom xyz
    cli_test.go:117: Testcase #22: earlyoom -i 1
    cli_test.go:117: Testcase #23: earlyoom -m 2,1
    cli_test.go:117: Testcase #24: earlyoom -m 1,2
    cli_test.go:117: Testcase #25: earlyoom -m 1,-1
    cli_test.go:117: Testcase #26: earlyoom -m 1000,-1000
    cli_test.go:117: Testcase #27: earlyoom -s 2,1
    cli_test.go:117: Testcase #28: earlyoom -s 1,2
    cli_test.go:117: Testcase #29: earlyoom -m 5,0
    cli_test.go:117: Testcase #30: earlyoom -m 5,9
    cli_test.go:117: Testcase #31: earlyoom -S 1133844
=== RUN   TestSanitize
--- PASS: TestSanitize (0.00s)
=== RUN   TestParseTuple
warning: SIGTERM value 5 is below SIGKILL value 9, setting SIGTERM = SIGKILL = 9
warning: SIGTERM value 0 is below SIGKILL value 5, setting SIGTERM = SIGKILL = 5
warning: SIGTERM value 4 is below SIGKILL value 5, setting SIGTERM = SIGKILL = 5
--- PASS: TestParseTuple (0.00s)
=== RUN   TestIsAlive
--- PASS: TestIsAlive (0.00s)
=== RUN   Test_fix_truncated_utf8
--- PASS: Test_fix_truncated_utf8 (0.00s)
FAIL
exit status 1
FAIL	_/var/tmp/portage/sys-apps/earlyoom-1.3/work/earlyoom-1.3/tests	1.832s
make: *** [Makefile:84: test] Error 1
@rfjakob
Copy link
Owner

rfjakob commented Jan 9, 2020

You either need to build from git or set VERSION

@ZeroChaos-
Copy link
Author

I tried both "VERSION=1.3 make test" and "make VERSION=1.3 test" and that didn't work. Did you mean something else perhaps?

@ZeroChaos-
Copy link
Author

nevermind I set it for make now, which I assume is what you meant, but the test still fails.

make -j1 earlyoom 
cc -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Os -march=native -mtune=native -pipe -frecord-gcc-switches -Wall -Wextra -DVERSION=\"1.3\" -g -fstack-protector-all -std=gnu99 -o earlyoom meminfo.c kill.c msg.c globals.c main.c sanitize.c
>>> Source compiled.
>>> Test phase: sys-apps/earlyoom-1.3
make -j1   test
cd tests ; go test -v
=== RUN   TestCli
--- FAIL: TestCli (1.83s)
    cli_test.go:117: Testcase #0: earlyoom -h
    cli_test.go:117: Testcase #1: earlyoom --help
    cli_test.go:117: Testcase #2: earlyoom 
    cli_test.go:117: Testcase #3: earlyoom -p
    cli_test.go:117: Testcase #4: earlyoom -v
    cli_test.go:137: stderr should contain "earlyoom v", but does not
    cli_test.go:148: stderr:
        earlyoom 1.3
    cli_test.go:149: stdout:
        (empty)
    cli_test.go:117: Testcase #5: earlyoom -d
    cli_test.go:129: stdout should contain "^ new victim (higher badness)", but does not
    cli_test.go:148: stderr:
        earlyoom 1.3
        mem total: 31812 MiB, swap total: 37278 MiB
        sending SIGTERM when mem <= 10 % and swap <= 10 %,
                SIGKILL when mem <=  5 % and swap <=  5 %
        Could not lock memory - continuing anyway: Cannot allocate memory
    cli_test.go:149: stdout:
        dry-running kill_largest_process()...
        pid     4: badness   0 vm_rss   1800 sandbox
            ^ new victim (higher vm_rss)
        pid     5: badness   0 vm_rss   6604 ebuild.sh
            ^ new victim (higher vm_rss)
        pid    22: badness   0 vm_rss   5716 ebuild.sh
        pid    41: badness   0 vm_rss   2804 make
        pid    45: badness   0 vm_rss   3428 sh
        pid    46: badness   0 vm_rss  18348 go
            ^ new victim (higher vm_rss)
        pid   660: badness   0 vm_rss   5016 tests.test
        pid   673: badness   0 vm_rss   2096 earlyoom
        selecting victim took 0.826 ms
        mem avail: 22658 of 31812 MiB (71 %), swap free: 36885 of 37278 MiB (98 %)
        adaptive sleep time: 1000 ms
    cli_test.go:117: Testcase #6: earlyoom -m 1
    cli_test.go:117: Testcase #7: earlyoom -m 0
    cli_test.go:117: Testcase #8: earlyoom -m -10
    cli_test.go:117: Testcase #9: earlyoom -m 100
    cli_test.go:117: Testcase #10: earlyoom -s 2
    cli_test.go:117: Testcase #11: earlyoom -s 100
    cli_test.go:117: Testcase #12: earlyoom -s 101
    cli_test.go:117: Testcase #13: earlyoom -s 0
    cli_test.go:117: Testcase #14: earlyoom -s -10
    cli_test.go:117: Testcase #15: earlyoom -M 645064
    cli_test.go:117: Testcase #16: earlyoom -M 9999999999999999
    cli_test.go:117: Testcase #17: earlyoom -r 0
    cli_test.go:117: Testcase #18: earlyoom -r 0.1
    cli_test.go:117: Testcase #19: earlyoom --avoid MyProcess1
    cli_test.go:117: Testcase #20: earlyoom --prefer MyProcess2
    cli_test.go:117: Testcase #21: earlyoom xyz
    cli_test.go:117: Testcase #22: earlyoom -i 1
    cli_test.go:117: Testcase #23: earlyoom -m 2,1
    cli_test.go:117: Testcase #24: earlyoom -m 1,2
    cli_test.go:117: Testcase #25: earlyoom -m 1,-1
    cli_test.go:117: Testcase #26: earlyoom -m 1000,-1000
    cli_test.go:117: Testcase #27: earlyoom -s 2,1
    cli_test.go:117: Testcase #28: earlyoom -s 1,2
    cli_test.go:117: Testcase #29: earlyoom -m 5,0
    cli_test.go:117: Testcase #30: earlyoom -m 5,9
    cli_test.go:117: Testcase #31: earlyoom -S 1133844
=== RUN   TestSanitize
--- PASS: TestSanitize (0.00s)
=== RUN   TestParseTuple
warning: SIGTERM value 5 is below SIGKILL value 9, setting SIGTERM = SIGKILL = 9
warning: SIGTERM value 0 is below SIGKILL value 5, setting SIGTERM = SIGKILL = 5
warning: SIGTERM value 4 is below SIGKILL value 5, setting SIGTERM = SIGKILL = 5
--- PASS: TestParseTuple (0.00s)
=== RUN   TestIsAlive
--- PASS: TestIsAlive (0.00s)
=== RUN   Test_fix_truncated_utf8
--- PASS: Test_fix_truncated_utf8 (0.00s)
FAIL
exit status 1
FAIL	_/var/tmp/portage/sys-apps/earlyoom-1.3/work/earlyoom-1.3/tests	1.833s
make: *** [Makefile:84: test] Error 1

@ZeroChaos-
Copy link
Author

by passing VERSION="v1.3" to make I got it to pass the version test, but it immediately failed on the next test

    cli_test.go:117: Testcase #4: earlyoom -v
    cli_test.go:117: Testcase #5: earlyoom -d
    cli_test.go:129: stdout should contain "^ new victim (higher badness)", but does not
    cli_test.go:148: stderr:
        earlyoom v1.3
        mem total: 31812 MiB, swap total: 37278 MiB
        sending SIGTERM when mem <= 10 % and swap <= 10 %,
                SIGKILL when mem <=  5 % and swap <=  5 %
        Could not lock memory - continuing anyway: Cannot allocate memory
    cli_test.go:149: stdout:
        dry-running kill_largest_process()...
        pid     4: badness   0 vm_rss   1652 sandbox
            ^ new victim (higher vm_rss)
        pid     5: badness   0 vm_rss   6636 ebuild.sh
            ^ new victim (higher vm_rss)
        pid    22: badness   0 vm_rss   5848 ebuild.sh
        pid    41: badness   0 vm_rss   2796 make
        pid    45: badness   0 vm_rss   3744 sh
        pid    46: badness   0 vm_rss  18864 go
            ^ new victim (higher vm_rss)
        pid   679: badness   0 vm_rss   5012 tests.test
        pid   692: badness   0 vm_rss   2028 earlyoom
        selecting victim took 1.412 ms
        mem avail: 23121 of 31812 MiB (72 %), swap free: 36939 of 37278 MiB (99 %)
        adaptive sleep time: 1000 ms
    cli_test.go:117: Testcase #6: earlyoom -m 1
    cli_test.go:117: Testcase #7: earlyoom -m 0
    cli_test.go:117: Testcase #8: earlyoom -m -10
    cli_test.go:117: Testcase #9: earlyoom -m 100
    cli_test.go:117: Testcase #10: earlyoom -s 2
    cli_test.go:117: Testcase #11: earlyoom -s 100
    cli_test.go:117: Testcase #12: earlyoom -s 101
    cli_test.go:117: Testcase #13: earlyoom -s 0
    cli_test.go:117: Testcase #14: earlyoom -s -10
    cli_test.go:117: Testcase #15: earlyoom -M 645064
    cli_test.go:117: Testcase #16: earlyoom -M 9999999999999999
    cli_test.go:117: Testcase #17: earlyoom -r 0
    cli_test.go:117: Testcase #18: earlyoom -r 0.1
    cli_test.go:117: Testcase #19: earlyoom --avoid MyProcess1
    cli_test.go:117: Testcase #20: earlyoom --prefer MyProcess2
    cli_test.go:117: Testcase #21: earlyoom xyz
    cli_test.go:117: Testcase #22: earlyoom -i 1
    cli_test.go:117: Testcase #23: earlyoom -m 2,1
    cli_test.go:117: Testcase #24: earlyoom -m 1,2
    cli_test.go:117: Testcase #25: earlyoom -m 1,-1
    cli_test.go:117: Testcase #26: earlyoom -m 1000,-1000
    cli_test.go:117: Testcase #27: earlyoom -s 2,1
    cli_test.go:117: Testcase #28: earlyoom -s 1,2
    cli_test.go:117: Testcase #29: earlyoom -m 5,0
    cli_test.go:117: Testcase #30: earlyoom -m 5,9
    cli_test.go:117: Testcase #31: earlyoom -S 1133844
=== RUN   TestSanitize

Is this broken because my build system isn't running as root, or something else?

@rfjakob
Copy link
Owner

rfjakob commented Jan 10, 2020

No, it's because you miss this fix: 3648b35

Can you try the latest version from git?

@ZeroChaos-
Copy link
Author

I pulled in that one patch and all tests pass now. thanks.
I also tested building and testing from git, all tests pass.
thanks for your hard work

@Apteryks
Copy link

@rfjakob Could I kindly request a new release (tag)? :-). I've been bitten by this test failure too, using the latest tag 1.3.

@rfjakob
Copy link
Owner

rfjakob commented Feb 27, 2020

I have tagged the version that fixes the problem as v1.3.1 now.

@ZeroChaos-
Copy link
Author

ZeroChaos- commented Feb 27, 2020 via email

@Apteryks
Copy link

Apteryks commented Feb 28, 2020 via email

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

No branches or pull requests

3 participants