Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fortio for openSUSE:Factory checked 
in at 2023-04-14 13:13:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fortio (Old)
 and      /work/SRC/openSUSE:Factory/.fortio.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fortio"

Fri Apr 14 13:13:58 2023 rev:37 rq:1079365 version:1.54.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/fortio/fortio.changes    2023-04-13 
14:11:16.560478636 +0200
+++ /work/SRC/openSUSE:Factory/.fortio.new.19717/fortio.changes 2023-04-14 
13:14:01.451888482 +0200
@@ -1,0 +2,8 @@
+Fri Apr 14 06:47:33 UTC 2023 - ka...@b1-systems.de
+
+- Update to version 1.54.2:
+  * Fixing a long standing bug with histogram buckets and payload
+    file error should abort (#746)
+  * Bump github/codeql-action from 2.2.9 to 2.2.11 (#745)
+
+-------------------------------------------------------------------

Old:
----
  fortio-1.54.1.obscpio

New:
----
  fortio-1.54.2.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fortio.spec ++++++
--- /var/tmp/diff_new_pack.KiXxCA/_old  2023-04-14 13:14:02.255893080 +0200
+++ /var/tmp/diff_new_pack.KiXxCA/_new  2023-04-14 13:14:02.259893103 +0200
@@ -19,7 +19,7 @@
 %define __arch_install_post export NO_BRP_STRIP_DEBUG=true
 
 Name:           fortio
-Version:        1.54.1
+Version:        1.54.2
 Release:        0
 Summary:        Load testing library, command line tool, advanced echo server 
and web UI
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.KiXxCA/_old  2023-04-14 13:14:02.295893308 +0200
+++ /var/tmp/diff_new_pack.KiXxCA/_new  2023-04-14 13:14:02.295893308 +0200
@@ -3,7 +3,7 @@
     <param name="url">https://github.com/fortio/fortio</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">v1.54.1</param>
+    <param name="revision">v1.54.2</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">enable</param>
     <param name="versionrewrite-pattern">v(.*)</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.KiXxCA/_old  2023-04-14 13:14:02.343893583 +0200
+++ /var/tmp/diff_new_pack.KiXxCA/_new  2023-04-14 13:14:02.347893606 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/fortio/fortio</param>
-              <param 
name="changesrevision">e3eb219b4181cec6c655df44b0ac4ca064eecd95</param></service></servicedata>
+              <param 
name="changesrevision">42273f0ee8694a35a90f6e192f61e0c17da9b874</param></service></servicedata>
 (No newline at EOF)
 

++++++ fortio-1.54.1.obscpio -> fortio-1.54.2.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/.github/workflows/codeql-analysis.yml 
new/fortio-1.54.2/.github/workflows/codeql-analysis.yml
--- old/fortio-1.54.1/.github/workflows/codeql-analysis.yml     2023-04-06 
17:13:21.000000000 +0200
+++ new/fortio-1.54.2/.github/workflows/codeql-analysis.yml     2023-04-14 
01:56:52.000000000 +0200
@@ -44,7 +44,7 @@
 
       # Initializes the CodeQL tools for scanning.
       - name: Initialize CodeQL
-        uses: 
github/codeql-action/init@04df1262e6247151b5ac09cd2c303ac36ad3f62b # pin@v2
+        uses: 
github/codeql-action/init@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # pin@v2
         with:
           languages: ${{ matrix.language }}
           # If you wish to specify custom queries, you can do so here or in a 
config file.
@@ -55,7 +55,7 @@
           # Autobuild attempts to build any compiled languages  (C/C++, C#, or 
Java).
           # If this step fails, then you should remove it and run the build 
manually (see below)
       - name: Autobuild
-        uses: 
github/codeql-action/autobuild@04df1262e6247151b5ac09cd2c303ac36ad3f62b # pin@v2
+        uses: 
github/codeql-action/autobuild@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # pin@v2
 
       # ℹ️ Command-line programs to run using the OS shell.
       # 📚 https://git.io/JvXDl
@@ -66,4 +66,4 @@
       #   make bootstrap
       #   make release
       - name: Perform CodeQL Analysis
-        uses: 
github/codeql-action/analyze@04df1262e6247151b5ac09cd2c303ac36ad3f62b # pin@v2
+        uses: 
github/codeql-action/analyze@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # pin@v2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/README.md new/fortio-1.54.2/README.md
--- old/fortio-1.54.1/README.md 2023-04-06 17:13:21.000000000 +0200
+++ new/fortio-1.54.2/README.md 2023-04-14 01:56:52.000000000 +0200
@@ -1,4 +1,4 @@
-<!-- 1.54.1 -->
+<!-- 1.54.2 -->
 # Fortio
 
 [![Awesome 
Go](https://fortio.org/mentioned-badge.svg)](https://github.com/avelino/awesome-go#networking)
@@ -60,13 +60,13 @@
 The [releases](https://github.com/fortio/fortio/releases) page has binaries 
for many OS/architecture combinations (see assets):
 
 ```shell
-curl -L 
https://github.com/fortio/fortio/releases/download/v1.54.1/fortio-linux_amd64-1.54.1.tgz
 \
+curl -L 
https://github.com/fortio/fortio/releases/download/v1.54.2/fortio-linux_amd64-1.54.2.tgz
 \
  | sudo tar -C / -xvzpf -
 # or the debian package
-wget 
https://github.com/fortio/fortio/releases/download/v1.54.1/fortio_1.54.1_amd64.deb
-dpkg -i fortio_1.54.1_amd64.deb
+wget 
https://github.com/fortio/fortio/releases/download/v1.54.2/fortio_1.54.2_amd64.deb
+dpkg -i fortio_1.54.2_amd64.deb
 # or the rpm
-rpm -i 
https://github.com/fortio/fortio/releases/download/v1.54.1/fortio-1.54.1-1.x86_64.rpm
+rpm -i 
https://github.com/fortio/fortio/releases/download/v1.54.2/fortio-1.54.2-1.x86_64.rpm
 # and more, see assets in release page
 ```
 
@@ -76,7 +76,7 @@
 brew install fortio
 ```
 
-On Windows, download 
https://github.com/fortio/fortio/releases/download/v1.54.1/fortio_win_1.54.1.zip
 and extract `fortio.exe` to any location, then using the Windows Command 
Prompt:
+On Windows, download 
https://github.com/fortio/fortio/releases/download/v1.54.2/fortio_win_1.54.2.zip
 and extract `fortio.exe` to any location, then using the Windows Command 
Prompt:
 ```
 fortio.exe server
 ```
@@ -127,7 +127,7 @@
 <!-- use release/updateFlags.sh to update this section -->
 <pre>
 <!-- USAGE_START -->
-Φορτίο 1.54.1 usage:
+Φορτίο 1.54.2 usage:
         fortio command [flags] target
 where command is one of: load (load testing), server (starts ui, rest api,
  http-echo, redirect, proxies, tcp-echo, udp-echo and grpc ping servers),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/bincommon/commonflags.go 
new/fortio-1.54.2/bincommon/commonflags.go
--- old/fortio-1.54.1/bincommon/commonflags.go  2023-04-06 17:13:21.000000000 
+0200
+++ new/fortio-1.54.2/bincommon/commonflags.go  2023-04-14 01:56:52.000000000 
+0200
@@ -211,7 +211,12 @@
        if *PayloadStreamFlag {
                httpOpts.PayloadReader = os.Stdin
        } else {
+               // Returns nil if file read error, an empty but non nil slice 
if no payload is requested.
                httpOpts.Payload = fnet.GeneratePayload(*PayloadFileFlag, 
*PayloadSizeFlag, *PayloadFlag)
+               if httpOpts.Payload == nil {
+                       // Error already logged
+                       os.Exit(1)
+               }
        }
        httpOpts.UnixDomainSocket = *unixDomainSocketFlag
        if *followRedirectsFlag {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/fnet/network.go 
new/fortio-1.54.2/fnet/network.go
--- old/fortio-1.54.1/fnet/network.go   2023-04-06 17:13:21.000000000 +0200
+++ new/fortio-1.54.2/fnet/network.go   2023-04-14 01:56:52.000000000 +0200
@@ -621,11 +621,12 @@
 
 // GeneratePayload generates a payload with given inputs.
 // First tries filePath, then random payload, at last payload.
+// Returns nil if file read error, an empty but non nil slice if no payload is 
requested.
 func GeneratePayload(payloadFilePath string, payloadSize int, payload string) 
[]byte {
        if len(payloadFilePath) > 0 {
                p, err := ReadFileForPayload(payloadFilePath)
                if err != nil {
-                       log.Warnf("File read operation failed %v", err)
+                       log.Errf("Payload file read operation failed: %v", err)
                        return nil
                }
                return p
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/go.mod new/fortio-1.54.2/go.mod
--- old/fortio-1.54.1/go.mod    2023-04-06 17:13:21.000000000 +0200
+++ new/fortio-1.54.2/go.mod    2023-04-14 01:56:52.000000000 +0200
@@ -3,7 +3,7 @@
 go 1.18
 
 require (
-       fortio.org/assert v1.1.4
+       fortio.org/assert v1.2.0
        fortio.org/cli v1.1.0
        fortio.org/dflag v1.5.2
        fortio.org/log v1.3.0
@@ -11,25 +11,26 @@
        fortio.org/version v1.0.2
        github.com/golang/protobuf v1.5.3
        github.com/google/uuid v1.3.0
-       golang.org/x/net v0.8.0
+       golang.org/x/net v0.9.0
        google.golang.org/grpc v1.54.0
 )
 
 // Local dev of dependencies changes
-// replace (
+//replace (
+//     fortio.org/assert => ../assert
 //     fortio.org/cli => ../cli
 //     fortio.org/dflag => ../dflag
 //     fortio.org/log => ../log
 //     fortio.org/scli => ../scli
 //     fortio.org/version => ../version
-// )
+//)
 
 require (
-       fortio.org/sets v1.0.2 // indirect
+       fortio.org/sets v1.0.3 // indirect
        github.com/fsnotify/fsnotify v1.6.0 // indirect
-       golang.org/x/exp v0.0.0-20230303215020-44a13b063f3e // indirect
-       golang.org/x/sys v0.6.0 // indirect
-       golang.org/x/text v0.8.0 // indirect
-       google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // 
indirect
-       google.golang.org/protobuf v1.28.1 // indirect
+       golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
+       golang.org/x/sys v0.7.0 // indirect
+       golang.org/x/text v0.9.0 // indirect
+       google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // 
indirect
+       google.golang.org/protobuf v1.30.0 // indirect
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/go.sum new/fortio-1.54.2/go.sum
--- old/fortio-1.54.1/go.sum    2023-04-06 17:13:21.000000000 +0200
+++ new/fortio-1.54.2/go.sum    2023-04-14 01:56:52.000000000 +0200
@@ -1,5 +1,5 @@
-fortio.org/assert v1.1.4 h1:Za1RaG+OjsTMpQS3J3UCvTF6wc4+IOHCz+jAOU37Y4o=
-fortio.org/assert v1.1.4/go.mod h1:039mG+/iYDPO8Ibx8TrNuJCm2T2SuhwRI3uL9nHTTls=
+fortio.org/assert v1.2.0 h1:XscfvR8yp4xW7OMCvNbCsieRFDxlwdEcb69+JZRp6LA=
+fortio.org/assert v1.2.0/go.mod h1:039mG+/iYDPO8Ibx8TrNuJCm2T2SuhwRI3uL9nHTTls=
 fortio.org/cli v1.1.0 h1:ATIxi7DgA7WAexUCF8p5a0qlGYk48ZgkwSEDrvwXeN4=
 fortio.org/cli v1.1.0/go.mod h1:O3nVImKwJSvHKbMYWkqMbEagAXCS1xvSv1YbHwkKJjY=
 fortio.org/dflag v1.5.2 h1:F9XVRj4Qr2IbJP7BMj7XZc9wB0Q/RZ61Ool+4YPVad8=
@@ -8,8 +8,8 @@
 fortio.org/log v1.3.0/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU=
 fortio.org/scli v1.3.1 h1:tQb46yH0djAokwXqguVUkp8C01LuCtURGJYLodvesvI=
 fortio.org/scli v1.3.1/go.mod h1:3Cnfp8mCj7TQSz97Y1oqA0GzLcFK8D9btfam4alE9B0=
-fortio.org/sets v1.0.2 h1:gSWZFg9rgzl1zJfI/93lDJKBFw8WZ3Uxe3oQ5uDM4T4=
-fortio.org/sets v1.0.2/go.mod h1:xVjulHr0FhlmReSymI+AhDtQ4FgjiazQ3JmuNpYFMs8=
+fortio.org/sets v1.0.3 h1:HzewdGjH69YmyW06yzplL35lGr+X4OcqQt0qS6jbaO4=
+fortio.org/sets v1.0.3/go.mod h1:QZVj0r6KP/ZD9ebySW9SgxVNy/NjghUfyHW9NN+WU+4=
 fortio.org/version v1.0.2 h1:8NwxdX58aoeKx7T5xAPO0xlUu1Hpk42nRz5s6e6eKZ0=
 fortio.org/version v1.0.2/go.mod 
h1:2JQp9Ax+tm6QKiGuzR5nJY63kFeANcgrZ0osoQFDVm0=
 github.com/fsnotify/fsnotify v1.6.0 
h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
@@ -21,21 +21,21 @@
 github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
 github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
 github.com/google/uuid v1.3.0/go.mod 
h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-golang.org/x/exp v0.0.0-20230303215020-44a13b063f3e 
h1:S8xf0d0OEmWrClvbMiUSp+7cGD00txONylwExlf9wR0=
-golang.org/x/exp v0.0.0-20230303215020-44a13b063f3e/go.mod 
h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
-golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
-golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+golang.org/x/exp v0.0.0-20230321023759-10a507213a29 
h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
+golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod 
h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
+golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
+golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
 golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
-golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
-golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
+golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod 
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 
h1:znp6mq/drrY+6khTAlJUDNFFcDGV2ENLYKpMq8SyCds=
-google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod 
h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw=
+google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 
h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
+google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod 
h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
 google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
 google.golang.org/grpc v1.54.0/go.mod 
h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod 
h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod 
h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.1 
h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
-google.golang.org/protobuf v1.28.1/go.mod 
h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.30.0 
h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
+google.golang.org/protobuf v1.30.0/go.mod 
h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/stats/stats.go 
new/fortio-1.54.2/stats/stats.go
--- old/fortio-1.54.1/stats/stats.go    2023-04-06 17:13:21.000000000 +0200
+++ new/fortio-1.54.2/stats/stats.go    2023-04-14 01:56:52.000000000 +0200
@@ -270,18 +270,25 @@
 
 // Records v value to count times.
 func (h *Histogram) record(v float64, count int) {
-       // Scaled value to bucketize - we subtract epsilon because the interval
+       // Scaled value to bucketize - we used to subtract epsilon because the 
interval
        // is open to the left ] start, end ] so when exactly on start it has
-       // to fall on the previous bucket. TODO add boundary tests
-       scaledVal := (v-h.Offset)/h.Divider - 0.0001
+       // to fall on the previous bucket: which is more correctly done using
+       // math.Ceil()-1 but that doesn't work... so back to epsilon distance 
check
+       scaledVal := (v - h.Offset) / h.Divider
        var idx int
        if scaledVal <= firstValue {
                idx = 0
        } else if scaledVal > lastValue {
                idx = numBuckets - 1 // last bucket is for > last value
        } else {
-               // else we look it up
-               idx = lookUpIdx(int(scaledVal))
+               // else we look it up (with the open interval adjustment)
+               svInt := int(scaledVal)
+               delta := scaledVal - float64(svInt)
+               if delta < 1e-12 {
+                       svInt--
+               }
+               log.Debugf("v %f -> scaledVal %.17f ceil %f delta %g - svInt 
%d", v, scaledVal, math.Ceil(scaledVal), delta, svInt)
+               idx = lookUpIdx(svInt)
        }
        h.Hdata[idx] += int32(count)
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fortio-1.54.1/stats/stats_test.go 
new/fortio-1.54.2/stats/stats_test.go
--- old/fortio-1.54.1/stats/stats_test.go       2023-04-06 17:13:21.000000000 
+0200
+++ new/fortio-1.54.2/stats/stats_test.go       2023-04-14 01:56:52.000000000 
+0200
@@ -23,6 +23,7 @@
        "os"
        "reflect"
        "testing"
+       "time"
 
        "fortio.org/assert"
        "fortio.org/log"
@@ -72,7 +73,7 @@
        _ = w.Flush()
        actual := b.String()
        if actual != expected {
-               t.Errorf("unexpected1:\n%s\nvs:\n%s\n", actual, expected)
+               t.Errorf("unexpected1:\n%s\nvs expected:\n%s\n", actual, 
expected)
        }
        b.Reset()
        c.Log("testLogH", nil)
@@ -85,7 +86,7 @@
 > 1022 <= 1023 , 1022.5 , 100.00, 1
 `
        if actual != expected {
-               t.Errorf("unexpected2:\n%s\nvs:\n%s\n", actual, expected)
+               t.Errorf("unexpected2:\n%s\nvs expected:\n%s\n", actual, 
expected)
        }
        log.SetOutput(os.Stderr)
 }
@@ -268,7 +269,7 @@
        var sum int64
        for i := 0; i < n; i++ {
                b := e.Data[i]
-               assert.Assert(t, b.Start <= b.End, "End should always be after 
Start")
+               assert.Assert(t, b.Start <= b.End, "End %f should always be 
after Start %f", b.End, b.Start)
                assert.Assert(t, b.Count > 0, "Every exported bucket should 
have data")
                assert.Assert(t, b.Percent > 0, "Percentage should always be 
positive")
                sum += b.Count
@@ -359,22 +360,32 @@
 }
 
 const (
-       NumRandomHistogram = 2000
+       NumRandomHistogram = 10000
 )
 
+func TestHistogramNegativeOffset(t *testing.T) {
+       // Check case where offset is negative and min value also negative
+       h := NewHistogram(-453.726, 94.80)
+       h.Record(-453.721)
+       h.Record(252)
+       CheckGenericHistogramDataProperties(t, h.Export())
+}
+
 func TestHistogramExportRandom(t *testing.T) {
+       seed := time.Now().UnixNano()
+       r := rand.New(rand.NewSource(seed))
        for i := 0; i < NumRandomHistogram; i++ {
                // offset [-500,500[  divisor ]0,100]
-               offset := (rand.Float64() - 0.5) * 1000
-               div := 100 * (1 - rand.Float64())
-               numEntries := 1 + rand.Int31n(10000)
+               offset := (r.Float64() - 0.5) * 1000
+               div := 100 * (1 - r.Float64())
+               numEntries := 1 + r.Int31n(10000)
                // fmt.Printf("new histogram with offset %g, div %g - will 
insert %d entries\n", offset, div, numEntries)
                h := NewHistogram(offset, div)
                var n int32
                var min float64
                var max float64
                for ; n < numEntries; n++ {
-                       v := 3000 * (rand.Float64() - 0.25)
+                       v := 3000 * (r.Float64() - 0.25)
                        if n == 0 {
                                min = v
                                max = v
@@ -394,6 +405,11 @@
                assert.CheckEquals(t, h.Max, max, "Max should match")
                assert.CheckEquals(t, e.Percentiles[0].Value, min, "p0 should 
be min")
                assert.CheckEquals(t, e.Percentiles[2].Value, max, "p100 should 
be max")
+               if t.Failed() {
+                       t.Logf("Failed seed %v iter %d, offset %v, div %v, 
numEntries %v", seed, i, offset, div, numEntries)
+                       t.Logf("%v", e)
+                       t.FailNow()
+               }
        }
 }
 

++++++ fortio.obsinfo ++++++
--- /var/tmp/diff_new_pack.KiXxCA/_old  2023-04-14 13:14:02.507894521 +0200
+++ /var/tmp/diff_new_pack.KiXxCA/_new  2023-04-14 13:14:02.507894521 +0200
@@ -1,5 +1,5 @@
 name: fortio
-version: 1.54.1
-mtime: 1680794001
-commit: e3eb219b4181cec6c655df44b0ac4ca064eecd95
+version: 1.54.2
+mtime: 1681430212
+commit: 42273f0ee8694a35a90f6e192f61e0c17da9b874
 

++++++ vendor.tar.gz ++++++
++++ 6850 lines of diff (skipped)

Reply via email to