Skip Menu |

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

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

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

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



Tried to install Test::Smoke in OS X 10.9.4 (Mavericks) (via cpan shell), got the below failure, perl is: This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-2level ... t/sysinfo.t ........... 16/55 Use of uninitialized value in join or string at t/sysinfo.t line 54. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. # Failed test 'tsuname(c)' # at t/sysinfo.t line 65. # got: '' # expected: undef Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in concatenation (.) or string at t/sysinfo.t line 80. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in concatenation (.) or string at t/sysinfo.t line 101. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in concatenation (.) or string at t/sysinfo.t line 115. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in concatenation (.) or string at t/sysinfo.t line 129. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. Use of uninitialized value in join or string at /Users/jhi/.cpan/build/Test-Smoke-1.6-gMt2bZ/blib/lib/Test/Smoke/SysInfo.pm line 867. # Looks like you failed 1 test of 55. t/sysinfo.t ........... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/55 subtests (less 1 skipped subtest: 53 okay) t/sysinfo_macos.t ..... ok t/sysinfo_proc.t ...... ok t/tree.t .............. ok t/ts_config.t ......... ok t/util-execute.t ...... ok t/util_times.t ........ ok t/vms_rl.t ............ skipped: This (darwin) is not VMS! Test Summary Report ------------------- t/sysinfo.t (Wstat: 256 Tests: 55 Failed: 1) Failed test: 24 Non-zero exit status: 1 Files=36, Tests=1495, 30 wallclock secs ( 0.44 usr 0.14 sys + 14.23 cusr 5.64 csys = 20.45 CPU) Result: FAIL Failed 1/36 test programs. 1/1495 subtests failed. make: *** [test_dynamic] Error 255 ABELTJE/Test-Smoke-1.6.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports ABELTJE/Test-Smoke-1.6.tar.gz Failed during this command: ABELTJE/Test-Smoke-1.6.tar.gz : make_test NO cpan[2]>
I started to set up an OS X 10.10 smoker tonight, but stopped at this. -- rjbs
I also now retried, and noticed that in addition to that test still failing, I'm getting dozens of messages of this kind: 2015-07-24 06:29:29.094 system_profiler[58357:1305786] platformPluginDictionary: Can't get X86PlatformPlugin, return value 0 from many (but not all) of the tests being run. These messages seem not to affect the success/failure of the tests, though. Someone else outside Perl has run into this, too: https://tickets.puppetlabs.com/browse/FACT-724 Seems to be some new Yosemite thing (google for platformPluginDictionary). I haven't seen this from building of the blead, so something Test::Smoke is doing?
Would you believe that this failure was due to one bit? I have a fix coming up.
So the problem was that "Of" doesn't match "of"... (1) OS X uses command line invocation /usr/sbin/system_profiler -detailLevel mini SPHardwareDataType to figure out system properties like the number of processors. (2) SysInfo.pm was expecting "Number of Processors" (or "Number of CPUs", in some older models). (3) I'm guessing (not found proof, but pretty confident) that in Yosemite someone in the secret dungeons of Apple changed the label of the property to be "Number Of Processors", so "o" -> "O", that one bit change... (4) SysInfo.pm uses hash lookup, so exact matches expected -> kaboom, the ncpu ended up being undef -> the sysinfo.t failure (5) The "platformPluginDictionary" noise was coming from the same system_profiler invocation. Probably harmless (famous last words?) Patch attached: for the property names I lowercased them, and for the noise I added "2>&1", clean out that known but probably harmless warning, but if there are other warnings, echo them explicitly.
Subject: smoke.patch
--- lib/Test/Smoke/SysInfo.pm.dist 2015-07-24 07:13:26.000000000 -0400 +++ lib/Test/Smoke/SysInfo.pm 2015-07-24 07:13:26.000000000 -0400 @@ -433,41 +433,58 @@ { local $^W = 0; $system_profiler_output = - `/usr/sbin/system_profiler -detailLevel mini SPHardwareDataType`; + `/usr/sbin/system_profiler -detailLevel mini SPHardwareDataType 2>&1`; } return BSD() unless $system_profiler_output; + if (defined $system_profiler_output) { + # In Yosemite the system_profiler started emitting these warnings: + # 2015-07-24 06:54:06.842 system_profiler[59780:1318389] platformPluginDictionary: Can\'t get X86PlatformPlugin, return value 0 + # They seem to be harmless, but annoying. + # Clean them out, but then warn about others from system_profiler. + $system_profiler_output =~ s/^\d{4}-\d\d-\d\d .+ system_profiler\[.+?\] platformPluginDictionary: Can't get X86PlatformPlugin, return value 0$//mg; + while ($system_profiler_output =~ /^(.+system_profiler.+)/mg) { + warn "Unexpected warning from system_profiler:\n$1\n"; + } + } + + # Remember to use lowercase forms of the property names. + # + # For example, it seems that Yosemite (10.10) cap-cased the "of" + # to "Of" in "Number of Processors", which broke things. + # https://rt.cpan.org/Ticket/Display.html?id=97441 + my %system_profiler; - $system_profiler{$1} = $2 + $system_profiler{lc($1)} = $2 while $system_profiler_output =~ m/^\s*([\w ]+):\s+(.+)$/gm; # convert newer output from Intel core duo my %keymap = ( - 'Processor Name' => 'CPU Type', - 'Processor Speed' => 'CPU Speed', - 'Model Name' => 'Machine Name', - 'Model Identifier' => 'Machine Model', - 'Number Of Processors' => 'Number Of CPUs', + 'processor name' => 'cpu type', + 'processor speed' => 'cpu speed', + 'model name' => 'machine name', + 'model identifier' => 'machine model', + 'number of processors' => 'number of cpus', ); for my $newkey ( keys %keymap ) { my $oldkey = $keymap{ $newkey }; - exists $system_profiler{ $newkey} and + exists $system_profiler{ $newkey } and $system_profiler{ $oldkey } = delete $system_profiler{ $newkey }; } - $system_profiler{'CPU Type'} =~ s/PowerPC\s*(\w+).*/macppc$1/; - $system_profiler{'CPU Speed'} =~ + $system_profiler{'cpu type'} =~ s/PowerPC\s*(\w+).*/macppc$1/; + $system_profiler{'cpu speed'} =~ s/(0(?:\.\d+)?)\s*GHz/sprintf("%d MHz", $1 * 1000)/e; - my $model = $system_profiler{'Machine Name'} || - $system_profiler{'Machine Model'}; + my $model = $system_profiler{'machine name'} || + $system_profiler{'machine model'}; - my $ncpu = $system_profiler{'Number Of CPUs'}; - $system_profiler{'Total Number Of Cores'} and - $ncpu .= " [$system_profiler{'Total Number Of Cores'} cores]"; + my $ncpu = $system_profiler{'number of cpus'}; + $system_profiler{'total number of cores'} and + $ncpu .= " [$system_profiler{'total number of cores'} cores]"; return { - _cpu_type => ($system_profiler{'CPU Type'} || __get_cpu_type()), - _cpu => ("$model ($system_profiler{'CPU Speed'})" || __get_cpu), + _cpu_type => ($system_profiler{'cpu type'} || __get_cpu_type()), + _cpu => ("$model ($system_profiler{'cpu speed'})" || __get_cpu), _ncpu => $ncpu, _host => __get_hostname(), _os => __get_os() . " (Mac OS X)",
Duh. The change was the other way round: Yosemite has "of", but the code was expecting "Of". Tweaked patch attached.
Subject: smoke.patch
--- lib/Test/Smoke/SysInfo.pm.dist 2015-07-24 07:13:26.000000000 -0400 +++ lib/Test/Smoke/SysInfo.pm 2015-07-24 07:27:03.000000000 -0400 @@ -433,41 +433,58 @@ { local $^W = 0; $system_profiler_output = - `/usr/sbin/system_profiler -detailLevel mini SPHardwareDataType`; + `/usr/sbin/system_profiler -detailLevel mini SPHardwareDataType 2>&1`; } return BSD() unless $system_profiler_output; + if (defined $system_profiler_output) { + # In Yosemite the system_profiler started emitting these warnings: + # 2015-07-24 06:54:06.842 system_profiler[59780:1318389] platformPluginDictionary: Can\'t get X86PlatformPlugin, return value 0 + # They seem to be harmless, but annoying. + # Clean them out, but then warn about others from system_profiler. + $system_profiler_output =~ s/^\d{4}-\d\d-\d\d .+ system_profiler\[.+?\] platformPluginDictionary: Can't get X86PlatformPlugin, return value 0$//mg; + while ($system_profiler_output =~ /^(.+system_profiler.+)/mg) { + warn "Unexpected warning from system_profiler:\n$1\n"; + } + } + + # Remember to use lowercase forms of the property names. + # + # For example, it seems that Yosemite (10.10) changed + # "Number Of Processors" to "Number of Processors", which broke things. + # https://rt.cpan.org/Ticket/Display.html?id=97441 + my %system_profiler; - $system_profiler{$1} = $2 + $system_profiler{lc($1)} = $2 while $system_profiler_output =~ m/^\s*([\w ]+):\s+(.+)$/gm; # convert newer output from Intel core duo my %keymap = ( - 'Processor Name' => 'CPU Type', - 'Processor Speed' => 'CPU Speed', - 'Model Name' => 'Machine Name', - 'Model Identifier' => 'Machine Model', - 'Number Of Processors' => 'Number Of CPUs', + 'processor name' => 'cpu type', + 'processor speed' => 'cpu speed', + 'model name' => 'machine name', + 'model identifier' => 'machine model', + 'number of processors' => 'number of cpus', ); for my $newkey ( keys %keymap ) { my $oldkey = $keymap{ $newkey }; - exists $system_profiler{ $newkey} and + exists $system_profiler{ $newkey } and $system_profiler{ $oldkey } = delete $system_profiler{ $newkey }; } - $system_profiler{'CPU Type'} =~ s/PowerPC\s*(\w+).*/macppc$1/; - $system_profiler{'CPU Speed'} =~ + $system_profiler{'cpu type'} =~ s/PowerPC\s*(\w+).*/macppc$1/; + $system_profiler{'cpu speed'} =~ s/(0(?:\.\d+)?)\s*GHz/sprintf("%d MHz", $1 * 1000)/e; - my $model = $system_profiler{'Machine Name'} || - $system_profiler{'Machine Model'}; + my $model = $system_profiler{'machine name'} || + $system_profiler{'machine model'}; - my $ncpu = $system_profiler{'Number Of CPUs'}; - $system_profiler{'Total Number Of Cores'} and - $ncpu .= " [$system_profiler{'Total Number Of Cores'} cores]"; + my $ncpu = $system_profiler{'number of cpus'}; + $system_profiler{'total number of cores'} and + $ncpu .= " [$system_profiler{'total number of cores'} cores]"; return { - _cpu_type => ($system_profiler{'CPU Type'} || __get_cpu_type()), - _cpu => ("$model ($system_profiler{'CPU Speed'})" || __get_cpu), + _cpu_type => ($system_profiler{'cpu type'} || __get_cpu_type()), + _cpu => ("$model ($system_profiler{'cpu speed'})" || __get_cpu), _ncpu => $ncpu, _host => __get_hostname(), _os => __get_os() . " (Mac OS X)",
Although this stuff has been split-off to System::Info commit 08ece41057938478d5353ef849efe45891d97e81 Author: abeltje <abeltje@test-smoke.org> Date: Sun May 26 18:04:25 2013 +0200 Apple changed the output of systemprofiler (again), adjust.