Skip Menu |

This queue is for tickets about the Test-Smoke CPAN distribution.

Report information
The Basics
Id: 39138
Status: resolved
Priority: 0/
Queue: Test-Smoke

People
Owner: Nobody in particular
Requestors: JDB [...] cpan.org
Cc:
AdminCc:

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



Subject: MSWin32 improvements
I've started running some bleadperl smokes on Windows Vista and found the attached patch useful: 1) It disables all error dialogs from a crashing application so I don't have to manually close those popups to get the smoke to continue. 2) It lowers the priority of the smoke processes to slightly below "normal" so that my interactive work on the machine takes precedence. The first change needs Win32::API and the second one Win32::Process; the patch simply doesn't apply the changes when those modules are missing in the Perl used to run the smoke.
Subject: smokeperl.diff
--- smokeperl.pl.orig Sat Jul 19 02:04:58 2008 +++ smokeperl.pl Mon Sep 08 13:34:04 2008 @@ -119,6 +119,30 @@ =cut +# MSWin32: Disable critical error popups and slightly lower priority +if ($^O eq "MSWin32") { + # Call kernel32.SetErrorMode(SEM_FAILCRITICALERRORS): + # "The system does not display the critical-error-handler message box. + # Instead, the system sends the error to the calling process." and + # "A child process inherits the error mode of its parent process." + if (eval {require Win32::API}) { + my $SetErrorMode + = Win32::API->new('kernel32', 'SetErrorMode', 'I', 'I'); + my $SEM_FAILCRITICALERRORS = 0x0001; + my $SEM_NOGPFAULTERRORBOX = 0x0002; + $SetErrorMode->Call($SEM_FAILCRITICALERRORS | $SEM_NOGPFAULTERRORBOX); + } + # Set priority just below normal (on Win2K and later) + require Win32; + my (undef, $major, undef, undef, $id) = Win32::GetOSVersion(); + if ($id ==2 && $major >= 5 && eval {require Win32::Process}) { + Win32::Process::Open(my $proc, $$, 0); + # constant not defined by older Win32::Process versions + my $BELOW_NORMAL_PRIORITY_CLASS = 0x00004000; + $proc->SetPriorityClass($BELOW_NORMAL_PRIORITY_CLASS); + } +} + # Try cwd() first, then $findbin my $config_file = File::Spec->catfile( cwd(), $options{config} ); unless ( read_config( $config_file ) ) {
On Tue Sep 09 17:28:10 2008, JDB wrote: Show quoted text
> I've started running some bleadperl smokes on Windows Vista and found > the attached patch useful: > > 1) It disables all error dialogs from a crashing application so I don't > have to manually close those popups to get the smoke to continue. > > 2) It lowers the priority of the smoke processes to slightly below > "normal" so that my interactive work on the machine takes precedence.
An alternative approach to disabling popup error dialogs is the attached batch file. My overnight Scheduled Tasks always run "seterrormode off" before launching the smoke proper, and then a clean-up task scheduled for each morning runs "seterrormode on" so that I get the popups back for interactive use during the day. What effect does your kernel32.SetErrorMode(SEM_FAILCRITICALERRORS) call have? Does it only affect the smoke process (and children), or does it affect the whole system? I'm guessing it affects the whole system (like my batch file does), in which case how do you re-enable popups? As for the process priority, I tried lowering that once before so that I could run smokes while using the same machine, but I found that it was still slowing things down too much, so I only ever smoke overnight now. Will your adjustment of the process priority slow down my overnight smoke, or will it have no effect on that since nothing else is happening anyway?
Download seterrormode.bat
application/octet-stream 2.1k

Message body not shown because it is not plain text.

RT-Send-CC: shay [...] cpan.org
On Wed Sep 10 05:17:28 2008, SHAY wrote: Show quoted text
> What effect does your kernel32.SetErrorMode(SEM_FAILCRITICALERRORS) call > have? Does it only affect the smoke process (and children), or does it > affect the whole system? I'm guessing it affects the whole system (like > my batch file does), in which case how do you re-enable popups?
Calling SetErrorMode() only affects the calling process and its children, so there is no need to re-enable popups. I prefer this to modifying the system defaults. Show quoted text
> As for the process priority, I tried lowering that once before so that I > could run smokes while using the same machine, but I found that it was > still slowing things down too much, so I only ever smoke overnight now.
The problem is that the smoke testing is very disk intensive, and lowering process priority doesn't help that much with the disk trashing. Putting the smoke directories on a separate disk (not partition, but physical disk) does help. Show quoted text
> Will your adjustment of the process priority slow down my overnight > smoke, or will it have no effect on that since nothing else is happening > anyway?
It will have no effect on the speed of your smoke if there are no CPU-intensive processes active that run with NORMAL priority.
RT-Send-CC: JDB [...] cpan.org
On Thu Sep 11 13:40:25 2008, JDB wrote: Show quoted text
> On Wed Sep 10 05:17:28 2008, SHAY wrote:
> > What effect does your kernel32.SetErrorMode(SEM_FAILCRITICALERRORS) call > > have? Does it only affect the smoke process (and children), or does it > > affect the whole system? I'm guessing it affects the whole system (like > > my batch file does), in which case how do you re-enable popups?
> > Calling SetErrorMode() only affects the calling process and its > children, so there is no need to re-enable popups. I prefer this to > modifying the system defaults. >
Ah, OK. In that case, it sounds much better than my hacky batch file approach. Show quoted text
> > As for the process priority, I tried lowering that once before so that I > > could run smokes while using the same machine, but I found that it was > > still slowing things down too much, so I only ever smoke overnight now.
> > The problem is that the smoke testing is very disk intensive, and > lowering process priority doesn't help that much with the disk trashing. > Putting the smoke directories on a separate disk (not partition, but > physical disk) does help. >
> > Will your adjustment of the process priority slow down my overnight > > smoke, or will it have no effect on that since nothing else is happening > > anyway?
> > It will have no effect on the speed of your smoke if there are no > CPU-intensive processes active that run with NORMAL priority.
I only have one physical disk in my machine so I'm definitely leaving my smokes scheduled for overnight only. Nothing much else runs overnight, so it sounds like your patch won't affect that at all.
Still looks sane, will be released with 1.70_11