Dear Monks,
I'm trying to install Tk from CPAN. Sometimes, everything goes just OK, but sometimes, a test fails:
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.02 sys + 0.98 cus +r 0.05 csys = 1.25 CPU) Result: PASS t/text.t .. 289/415 Stack moved 887d7ec => 887d7f0 t/text.t .. ok All tests successful.
versus
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 + 0.94 cus +r 0.05 csys = 1.22 CPU) Result: PASS t/text.t .. 247/415 # Failed test at t/text.t line 1548. # '' # doesn't match '(?-xism:PRIMARY\ selection\ doesn\'t\ exist\ or\ +form\ \"STRING\"\ not\ defined)' Stack moved 887d934 => 887d938 t/text.t .. 403/415 # Looks like you failed 1 test of 415. t/text.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/415 subtests (less 32 skipped subtests: 382 okay) (1 TODO test unexpectedly succeeded)
The sometimes failing test is this one:
{ $t2->destroy if Tk::Exists($t2); $t2 = $mw->Text; $t2->insert('1.0', "abcdef\nghijk\n1234"); $t2->tagAdd('sel', '1.0', '1.3'); is($mw->SelectionGet, 'abc'); $mw->SelectionClear; # * eval { $mw->SelectionGet }; like($@, qr{\QPRIMARY selection doesn't exist or form "STRING" not + defined}); $t2->tagAdd('sel', '1.0', '1.3'); is($mw->SelectionGet, 'abc'); }
If I add a sleep 1; before the eval line (marked with *), the test passes everytimes. The question is: is this a bug? Or just a poorly written test? Or...?
Running perl 5.12.1, openSUSE 11.3 with KDE 4.4.4.

In reply to Tk: Cannot install from CPAN sometimes. by choroba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.