Skip Menu |

This queue is for tickets about the StorageDisplay CPAN distribution.

Report information
The Basics
Id: 132297
Status: open
Priority: 0/
Queue: StorageDisplay

People
Owner: vdanjean.ml [...] free.fr
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: t/10_reference.t may fail with num vs. string diff (1.0.3)
On some of my smoker systems t/10_reference.t fails: ... # Failed test 'data/dahu-node.ref.data and data/dahu-node.data contents are the same' # at t/10_reference.t line 48. # --- data/dahu-node.ref.data Sat Apr 4 10:52:31 2020 # +++ data/dahu-node.data Sat Apr 4 11:05:57 2020 # @@ -7,7 +7,7 @@ # 'dm' => {}, # 'fs' => { # '/dev/sda1' => { # - 'free' => 3999264768, # + 'free' => '3999264768', # 'fstype' => 'swap', # 'mountpoint' => 'SWAP', # 'size' => '3999264768', # Failed test 'data/yeti-node.ref.data and data/yeti-node.data contents are the same' # at t/10_reference.t line 48. # --- data/yeti-node.ref.data Sat Apr 4 10:52:31 2020 # +++ data/yeti-node.data Sat Apr 4 11:06:05 2020 # @@ -3,7 +3,7 @@ # 'dm' => {}, # 'fs' => { # '/dev/sda1' => { # - 'free' => 3999264768, # + 'free' => '3999264768', # 'fstype' => 'swap', # 'mountpoint' => 'SWAP', # 'size' => '3999264768', # Seeded srand with seed '20200404' from local date. # Looks like you failed 2 tests of 58. t/10_reference.t ....... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/58 subtests ... Just a guess: maybe this happens if an older Data::Dumper is installed (I remember that old Data::Dumper used the pure perl dumper in some situations, and the pure perl dumper probably cannot determine if a scalar is internally stored as an integer).
On 2020-04-04 09:05:54, SREZIC wrote: Show quoted text
> On some of my smoker systems t/10_reference.t fails: > > ... > # Failed test 'data/dahu-node.ref.data and data/dahu-node.data > contents are the same' > # at t/10_reference.t line 48. > # --- data/dahu-node.ref.data Sat Apr 4 10:52:31 2020 > # +++ data/dahu-node.data Sat Apr 4 11:05:57 2020 > # @@ -7,7 +7,7 @@ > # 'dm' => {}, > # 'fs' => { > # '/dev/sda1' => { > # - 'free' => 3999264768, > # + 'free' => '3999264768', > # 'fstype' => 'swap', > # 'mountpoint' => 'SWAP', > # 'size' => '3999264768', > > # Failed test 'data/yeti-node.ref.data and data/yeti-node.data > contents are the same' > # at t/10_reference.t line 48. > # --- data/yeti-node.ref.data Sat Apr 4 10:52:31 2020 > # +++ data/yeti-node.data Sat Apr 4 11:06:05 2020 > # @@ -3,7 +3,7 @@ > # 'dm' => {}, > # 'fs' => { > # '/dev/sda1' => { > # - 'free' => 3999264768, > # + 'free' => '3999264768', > # 'fstype' => 'swap', > # 'mountpoint' => 'SWAP', > # 'size' => '3999264768', > # Seeded srand with seed '20200404' from local date. > # Looks like you failed 2 tests of 58. > t/10_reference.t ....... > Dubious, test returned 2 (wstat 512, 0x200) > Failed 2/58 subtests > ... > > Just a guess: maybe this happens if an older Data::Dumper is installed > (I remember that old Data::Dumper used the pure perl dumper in some > situations, and the pure perl dumper probably cannot determine if a > scalar is internally stored as an integer).
Well, upgrading Data::Dumper does not help.
Hi, On Sat Apr 04 09:09:31 2020, SREZIC wrote: Show quoted text
> On 2020-04-04 09:05:54, SREZIC wrote:
> > On some of my smoker systems t/10_reference.t fails: > > > > ... > > # Failed test 'data/dahu-node.ref.data and data/dahu-node.data > > contents are the same' > > # at t/10_reference.t line 48. > > # --- data/dahu-node.ref.data Sat Apr 4 10:52:31 2020 > > # +++ data/dahu-node.data Sat Apr 4 11:05:57 2020 > > # @@ -7,7 +7,7 @@ > > # 'dm' => {}, > > # 'fs' => { > > # '/dev/sda1' => { > > # - 'free' => 3999264768, > > # + 'free' => '3999264768', > > # 'fstype' => 'swap', > > # 'mountpoint' => 'SWAP', > > # 'size' => '3999264768', > > > > # Failed test 'data/yeti-node.ref.data and data/yeti-node.data > > contents are the same' > > # at t/10_reference.t line 48. > > # --- data/yeti-node.ref.data Sat Apr 4 10:52:31 2020 > > # +++ data/yeti-node.data Sat Apr 4 11:06:05 2020 > > # @@ -3,7 +3,7 @@ > > # 'dm' => {}, > > # 'fs' => { > > # '/dev/sda1' => { > > # - 'free' => 3999264768, > > # + 'free' => '3999264768', > > # 'fstype' => 'swap', > > # 'mountpoint' => 'SWAP', > > # 'size' => '3999264768', > > # Seeded srand with seed '20200404' from local date. > > # Looks like you failed 2 tests of 58. > > t/10_reference.t ....... > > Dubious, test returned 2 (wstat 512, 0x200) > > Failed 2/58 subtests > > ... > > > > Just a guess: maybe this happens if an older Data::Dumper is installed > > (I remember that old Data::Dumper used the pure perl dumper in some > > situations, and the pure perl dumper probably cannot determine if a > > scalar is internally stored as an integer).
> > Well, upgrading Data::Dumper does not help.
The value comes from this code: if ($line =~ m,([^ ]+) partition ([0-9]+) ([0-9]+)$,) { $fs->{$1} = { size => $2, used => $3, free => $2-$3, fstype => 'swap', mountpoint => 'SWAP', }; 'size' ($2) and 'used' ($3) are stored as string (part of a regexp) 'free' is the result of a computation (that coerce strings into their integer value) I probably can workaround the problem by coercing free value into a string again ( free => ($2-$3).'' ). I tried it locally and, indeed, I see a string for the 'free' value (so I would have to update my reference files) but I would like to know the root cause. Do you know how to check if the value in the hash is a string or a number if I keep "free => $2-$3"? I added a test in 1.0.4 to check Data::Dumper behavior. Let's see. Regards, Vincent
On Sat Apr 04 16:06:28 2020, VDANJEAN wrote: Show quoted text
> Hi, > > On Sat Apr 04 09:09:31 2020, SREZIC wrote:
> > On 2020-04-04 09:05:54, SREZIC wrote:
> > > On some of my smoker systems t/10_reference.t fails: > > > > > > ... > > > # Failed test 'data/dahu-node.ref.data and data/dahu-node.data > > > contents are the same' > > > # at t/10_reference.t line 48. > > > # --- data/dahu-node.ref.data Sat Apr 4 10:52:31 2020 > > > # +++ data/dahu-node.data Sat Apr 4 11:05:57 2020 > > > # @@ -7,7 +7,7 @@ > > > # 'dm' => {}, > > > # 'fs' => { > > > # '/dev/sda1' => { > > > # - 'free' => 3999264768, > > > # + 'free' => '3999264768', > > > # 'fstype' => 'swap', > > > # 'mountpoint' => 'SWAP', > > > # 'size' => '3999264768', > > > > > > # Failed test 'data/yeti-node.ref.data and data/yeti-node.data > > > contents are the same' > > > # at t/10_reference.t line 48. > > > # --- data/yeti-node.ref.data Sat Apr 4 10:52:31 2020 > > > # +++ data/yeti-node.data Sat Apr 4 11:06:05 2020 > > > # @@ -3,7 +3,7 @@ > > > # 'dm' => {}, > > > # 'fs' => { > > > # '/dev/sda1' => { > > > # - 'free' => 3999264768, > > > # + 'free' => '3999264768', > > > # 'fstype' => 'swap', > > > # 'mountpoint' => 'SWAP', > > > # 'size' => '3999264768', > > > # Seeded srand with seed '20200404' from local date. > > > # Looks like you failed 2 tests of 58. > > > t/10_reference.t ....... > > > Dubious, test returned 2 (wstat 512, 0x200) > > > Failed 2/58 subtests > > > ... > > > > > > Just a guess: maybe this happens if an older Data::Dumper is > > > installed > > > (I remember that old Data::Dumper used the pure perl dumper in some > > > situations, and the pure perl dumper probably cannot determine if a > > > scalar is internally stored as an integer).
> > > > Well, upgrading Data::Dumper does not help.
> > The value comes from this code: > > if ($line =~ m,([^ ]+) partition ([0-9]+) ([0-9]+)$,) { > $fs->{$1} = { > size => $2, > used => $3, > free => $2-$3, > fstype => 'swap', > mountpoint => 'SWAP', > }; > > 'size' ($2) and 'used' ($3) are stored as string (part of a regexp) > 'free' is the result of a computation (that coerce strings into their > integer value) > I probably can workaround the problem by coercing free value into a > string again ( free => ($2-$3).'' ). I tried it locally and, indeed, I > see a string for the 'free' value (so I would have to update my > reference files) but I would like to know the root cause. > Do you know how to check if the value in the hash is a string or a > number if I keep "free => $2-$3"? > > I added a test in 1.0.4 to check Data::Dumper behavior. Let's see.
It does not seem to come from Data::Dumper. I've no idea of the root cause for now. I will investigate. Regards, Vincent Show quoted text
> > Regards, > Vincent