Skip Menu |

This queue is for tickets about the Imager-Screenshot CPAN distribution.

Report information
The Basics
Id: 34792
Status: resolved
Priority: 0/
Queue: Imager-Screenshot

People
Owner: TONYC [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: t/30tkx11.t: label: Cannot XGetImage: BadMatch
The 30tkx11 test ocassionally fails: 1..2 # label: Cannot XGetImage: BadMatch (invalid parameter attributes) ok 1 - grab from a Tk widget (X11) not ok 2 - grab label from a Tk widget (X11) # Failed test 'grab label from a Tk widget (X11)' # in t/30tkx11.t at line 42. # Looks like you failed 1 test of 2. This is on a FreeBSD system, perl 5.8.8 and the newest Tk from subversion. I'll do some more research why this happens. Maybe it's just load-related, this machine has a constant high load average of 5 to 7. Regards, Slaven
On Wed Apr 09 15:33:10 2008, SREZIC wrote: Show quoted text
> The 30tkx11 test ocassionally fails: > > 1..2 > # label: Cannot XGetImage: BadMatch (invalid parameter attributes) > ok 1 - grab from a Tk widget (X11) > not ok 2 - grab label from a Tk widget (X11) > # Failed test 'grab label from a Tk widget (X11)' > # in t/30tkx11.t at line 42. > # Looks like you failed 1 test of 2. > > This is on a FreeBSD system, perl 5.8.8 and the newest Tk from subversion. > > I'll do some more research why this happens. Maybe it's just > load-related, this machine has a constant high load average of 5 to 7. >
Yes, it seems that the after delay is sometimes too short. I put a warn $label->viewable; in the after callback and when it returns 0, the test fails. So probably you should check if $mw and $label are viewable, and if not, wait for another 100ms. Regards, Slaven
Subject: Re: [rt.cpan.org #34792] t/30tkx11.t: label: Cannot XGetImage: BadMatch
Date: Thu, 10 Apr 2008 07:20:46 +1000
To: Slaven_Rezic via RT <bug-Imager-Screenshot [...] rt.cpan.org>
From: tonyc [...] cpan.org
On Wed, Apr 09, 2008 at 03:36:53PM -0400, Slaven_Rezic via RT wrote: Show quoted text
> Yes, it seems that the after delay is sometimes too short. I put a > > warn $label->viewable; > > in the after callback and when it returns 0, the test fails. So probably > you should check if $mw and $label are viewable, and if not, wait for > another 100ms.
Perhaps I should be using waitVisibility(). Does the following change make it more reliable? Index: t/30tkx11.t =================================================================== --- t/30tkx11.t (revision 1450) +++ t/30tkx11.t (working copy) @@ -29,6 +29,7 @@ my ($im_mw, $im_label); my $label = $mw->Label(-text => "test: $0")->pack; +$label->waitVisibility; $mw->after(100 => sub { $im_mw = screenshot(widget => $mw, decor => 1) Thanks Tony
On Wed Apr 09 17:21:06 2008, TONYC wrote: Show quoted text
> On Wed, Apr 09, 2008 at 03:36:53PM -0400, Slaven_Rezic via RT wrote: >
> > Yes, it seems that the after delay is sometimes too short. I put a > > > > warn $label->viewable; > > > > in the after callback and when it returns 0, the test fails. So probably > > you should check if $mw and $label are viewable, and if not, wait for > > another 100ms.
> > Perhaps I should be using waitVisibility(). > > Does the following change make it more reliable? > > Index: t/30tkx11.t > =================================================================== > --- t/30tkx11.t (revision 1450) > +++ t/30tkx11.t (working copy) > @@ -29,6 +29,7 @@ > > my ($im_mw, $im_label); > my $label = $mw->Label(-text => "test: $0")->pack; > +$label->waitVisibility; > $mw->after(100 => > sub { > $im_mw = screenshot(widget => $mw, decor => 1) > > Thanks > Tony
Yes, looks better now. I have an endless loop running for five minutes and there was no failure so far. Previously the failure occurred quite fast. Regards, Slaven
On Thu Apr 10 16:13:30 2008, SREZIC wrote: Show quoted text
> Yes, looks better now. I have an endless loop running for five minutes > and there was no failure so far. Previously the failure occurred quite
fast. This change is released in Imager::Screenshot 0.007. Thanks for your help in resolving this. Tony