Subject: | race condition in t/01_basic.t detects "closed" Notepad window, fails test |
Summary: t/01_basic.t test 15 fails, detecting a Notepad window after
the previous test has closed it.
Symptoms: failure reported for test 15, "No notepad open now". Complete
output from prove is in the attachment prove_output.txt.
To reproduce: in distribution directory Win32-GuiTest-1.56 (command
lines for Strawberry Perl, WinXP):
perl Makefile.PL
dmake
prove -b -v t\01_basic.t
Workaround: Add a sleep() to 01_basic.t after line 79, which is where
the Notepad window is closed. This gives the Notepad window time to
finish closing before the next test checks whether it's still there.
SendKeys("{PAU 1000}%{F4}{TAB}{ENTER}");
sleep 1; # <-- ADD THIS LINE
A better fix might be to have the next test do a sleep-and-retry (just
once) if it fails.
Platform: Strawberry Perl 5.10.0 on Windows XP SP3. Output from perl -V
is attached as perl-v.txt.
Subject: | prove_output.txt |
>prove -v -b t\01_basic.t
t\01_basic.t ..
ok 1 - Check there are windows
ok 2 - No duplicates
ok 3
ok 4 - The desktop is not on the window list
ok 5 - There is one notepad open with README in it
ok 6 - The same from FindWindowLike
ok 7 - The two windows are the same
ok 8 - Edit window found within notepad
ok 9 - we have Win32::GuiTest in the text
ok 10 - in the file too
ok 11 - file is identical to what is in notepad
ok 12 - New notepad opened
ok 13 - same here
ok 14 - WindowIDs are identical
not ok 15 - No notepad open now
# Failed test 'No notepad open now'
# at t\01_basic.t line 83.
# got: '1'
# expected: '0'
ok 16 - no children with less that 1 Depth
ok 17 - FindWindowLike and GetChildWindows are the same here
ok 18 - MFC windows sanity check
ok 19 - sys windows sanity check
not ok 20
# Failed test at t\01_basic.t line 119.
# Structures begin differing at:
# $got->[2] = '66954'
# $expected->[2] = '131282'
# Looks like you failed 2 tests of 24.
ok 21 - x coordinate is greater than 0
ok 22 - y coordinate is greater than 0
ok 23
ok 24
1..24
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/24 subtests
Test Summary Report
-------------------
t\01_basic.t (Wstat: 512 Tests: 24 Failed: 2)
Failed tests: 15, 20
Non-zero exit status: 2
Files=1, Tests=24, 9 wallclock secs ( 0.08 usr + 0.00 sys = 0.08 CPU)
Result: FAIL
Subject: | perl-v.txt |
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname='Win32 strawberryperl 5.10.0.6 #1 Wed Jul 29 22:19:01 2009 i386'
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX',
optimize='-s -O2',
cppflags='-DWIN32'
ccversion='', gccversion='3.4.5', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
libpth=C:\strawberry\c\lib
libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
libc=-lmsvcrt, so=dll, useshrplib=true, libperl=libperl510.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
USE_LARGE_FILES USE_PERLIO
Built under MSWin32
Compiled at Jul 29 2009 22:37:03
%ENV:
PERL5_CPANPLUS_IS_RUNNING="5504"
PERL5_CPANPLUS_IS_VERSION="0.88"
PERLDOC_PAGER="less"
PERL_AUTOINSTALL="--defaultdeps"
PERL_READLINE_NOWARN="1"
@INC:
C:/strawberry/perl/lib
C:/strawberry/perl/site/lib
.