in reply to Re: Tk: Cannot install from CPAN sometimes.
in thread Tk: Cannot install from CPAN sometimes.

It is exactly what I did. Sometimes, the tests are OK and installation is possible, sometimes it is not. I tried running just the single test for many times, without the sleep, it just randomly fails.
For example:
root@weed# for a in {1..10} ; do /usr/bin/perl "-It" "-MTkTest" "-MExt +Utils::Command::MM" "-e" "check_display_harness; test_harness(0, 'bli +b/lib', 'blib/arch')" t/text.t ; done t/text.t .. 70/415 # Failed test at t/text.t line 1549. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 896c3e4 => 896c3e8 t/text.t .. 394/415 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 37 skipped subtests: 377 okay) (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- t/text.t (Wstat: 256 Tests: 415 Failed: 1) Failed test: 292 TODO passed: 121 Non-zero exit status: 1 Files=1, Tests=415, 2 wallclock secs ( 0.20 usr 0.02 sys + 1.09 cus +r 0.04 csys = 1.35 CPU) Result: FAIL Failed 1/1 test programs. 1/415 subtests failed. t/text.t .. 279/415 # Failed test at t/text.t line 1549. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 896c43c => 896c440 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 37 skipped subtests: 377 okay) (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- t/text.t (Wstat: 256 Tests: 415 Failed: 1) Failed test: 292 TODO passed: 121 Non-zero exit status: 1 Files=1, Tests=415, 2 wallclock secs ( 0.22 usr 0.01 sys + 1.12 cus +r 0.06 csys = 1.41 CPU) Result: FAIL Failed 1/1 test programs. 1/415 subtests failed. t/text.t .. 4/415 # Failed test at t/text.t line 1549. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 896c39c => 896c3a0 t/text.t .. 361/415 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 37 skipped subtests: 377 okay) (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- t/text.t (Wstat: 256 Tests: 415 Failed: 1) Failed test: 292 TODO passed: 121 Non-zero exit status: 1 Files=1, Tests=415, 2 wallclock secs ( 0.22 usr 0.02 sys + 1.11 cus +r 0.07 csys = 1.42 CPU) Result: FAIL Failed 1/1 test programs. 1/415 subtests failed. t/text.t .. 275/415 # Failed test at t/text.t line 1549. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 896c3ac => 896c3b0 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 37 skipped subtests: 377 okay) (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- t/text.t (Wstat: 256 Tests: 415 Failed: 1) Failed test: 292 TODO passed: 121 Non-zero exit status: 1 Files=1, Tests=415, 3 wallclock secs ( 0.21 usr 0.01 sys + 1.12 cus +r 0.06 csys = 1.40 CPU) Result: FAIL Failed 1/1 test programs. 1/415 subtests failed. t/text.t .. 291/415 Stack moved 896c4bc => 896c4c0 t/text.t .. ok All tests successful. Test Summary Report ------------------- t/text.t (Wstat: 0 Tests: 415 Failed: 0) TODO passed: 121 Files=1, Tests=415, 2 wallclock secs ( 0.20 usr 0.01 sys + 1.14 cus +r 0.05 csys = 1.40 CPU) Result: PASS t/text.t .. 192/415 Stack moved 896c39c => 896c3a0 t/text.t .. ok All tests successful. Test Summary Report ------------------- t/text.t (Wstat: 0 Tests: 415 Failed: 0) TODO passed: 121 Files=1, Tests=415, 3 wallclock secs ( 0.22 usr 0.02 sys + 1.13 cus +r 0.04 csys = 1.41 CPU) Result: PASS t/text.t .. 282/415 # Failed test at t/text.t line 1549. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 896c4b4 => 896c4b8 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 37 skipped subtests: 377 okay) (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- t/text.t (Wstat: 256 Tests: 415 Failed: 1) Failed test: 292 TODO passed: 121 Non-zero exit status: 1 Files=1, Tests=415, 2 wallclock secs ( 0.20 usr 0.02 sys + 1.14 cus +r 0.04 csys = 1.40 CPU) Result: FAIL Failed 1/1 test programs. 1/415 subtests failed. t/text.t .. 34/415 Stack moved 896c4c4 => 896c4c8 t/text.t .. ok All tests successful. Test Summary Report ------------------- t/text.t (Wstat: 0 Tests: 415 Failed: 0) TODO passed: 121 Files=1, Tests=415, 2 wallclock secs ( 0.22 usr 0.01 sys + 1.11 cus +r 0.04 csys = 1.38 CPU) Result: PASS t/text.t .. 282/415 # Failed test at t/text.t line 1549. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 896c4c4 => 896c4c8 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 37 skipped subtests: 377 okay) (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- t/text.t (Wstat: 256 Tests: 415 Failed: 1) Failed test: 292 TODO passed: 121 Non-zero exit status: 1 Files=1, Tests=415, 2 wallclock secs ( 0.19 usr 0.03 sys + 1.08 cus +r 0.04 csys = 1.34 CPU) Result: FAIL Failed 1/1 test programs. 1/415 subtests failed. t/text.t .. 146/415 # Failed test at t/text.t line 1549. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 896c4b4 => 896c4b8 t/text.t .. 395/415 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 37 skipped subtests: 377 okay) (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- t/text.t (Wstat: 256 Tests: 415 Failed: 1) Failed test: 292 TODO passed: 121 Non-zero exit status: 1 Files=1, Tests=415, 3 wallclock secs ( 0.20 usr 0.01 sys + 1.11 cus +r 0.04 csys = 1.36 CPU) Result: FAIL Failed 1/1 test programs. 1/415 subtests failed.
Or, shorter:
root@weed# for a in {1..25} ; do /usr/bin/perl "-It" "-MTkTest" "-MExt +Utils::Command::MM" "-e" "check_display_harness; test_harness(0, 'bli +b/lib', 'blib/arch')" t/text.t ; done 2>/dev/null | grep Result: | s +ort | uniq -c 22 Result: FAIL 3 Result: PASS

Replies are listed 'Best First'.
Re^3: Tk: Cannot install from CPAN sometimes.
by zentara (Cardinal) on Oct 28, 2010 at 19:36 UTC
    It must be some peculiarity of your system. Instead of your odd test command:
    root@weed# for a in {1..25} ; do /usr/bin/perl "-It" "-MTkTest" "-MExt +Utils::Command::MM" "-e" "check_display_harness; test_harness(0, 'bli +b/lib', 'blib/arch')" t/text.t ; done 2>/dev/null | grep Result: | s +ort | uniq -c
    Can you do this:

    unpack the tarball, perl Makefile.PL, make, make test, make install (as root)?


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
      Yes, I tried several times. Sometimes, everything goes well, but sometimes not. The test that fails is shown in my "odd" test command.
        I tried several times. Sometimes, everything goes well, but sometimes not.

        I don't understand. Are you trying to repeatedly install to the same machine? If so, why not stop when everything goes well?

        If you are just compulsive about getting an install process to go flawlessly, without test failure warnings, Tk is the wrong module to choose to test. Just google for "perl Tk test failures" and you will see that many of the tests are expected to fail, as bug fixes and other code improvements are incorporated into the code, and the overworked module maintainer can't waste time updating the test harness.

        I suppose your assumption that Tk's test code is poor, may be accurate, especially in how it cooperates with a CPAN install. If the module works, don't worry about test failures.

        The CPAN install process itself, may be part of the problem. If you install once, and it fails, you probably need to manually delete the Tk source from the ~/.cpan/build subdirectory, as subsequent builds may be corrupted by previous ones.

        If you are trying to install to multiple machines, and getting failures on some, you need to look at the differences in the machines. You may not be able to install Tk thru CPAN on all machines. I always go thru the manual route... download tarball, perl Makefile.PL, make, sudo make install.... and watch for errors issued by Tk itself.


        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh