Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package fortio for openSUSE:Factory checked in at 2022-05-31 15:47:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fortio (Old) and /work/SRC/openSUSE:Factory/.fortio.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "fortio" Tue May 31 15:47:25 2022 rev:14 rq:979925 version:1.32.2 Changes: -------- --- /work/SRC/openSUSE:Factory/fortio/fortio.changes 2022-05-24 20:32:16.346967894 +0200 +++ /work/SRC/openSUSE:Factory/.fortio.new.1548/fortio.changes 2022-05-31 15:48:35.916036672 +0200 @@ -1,0 +2,14 @@ +Mon May 30 14:32:03 UTC 2022 - kastl@b1-systems.de + +- Update to version 1.32.2: + * fixing missing write timeout (#584) + * removing testify dependency, fixing security issue in dep (#582) + +------------------------------------------------------------------- +Mon May 30 14:31:04 UTC 2022 - kastl@b1-systems.de + +- Update to version 1.32.1: + * use h2c fixed version of x/net (#581) + * blind fix/attempt for transient build process failure to upload artifacts (#579) + +------------------------------------------------------------------- Old: ---- fortio-1.32.0.tar.gz New: ---- fortio-1.32.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fortio.spec ++++++ --- /var/tmp/diff_new_pack.HXdhjV/_old 2022-05-31 15:48:36.408036999 +0200 +++ /var/tmp/diff_new_pack.HXdhjV/_new 2022-05-31 15:48:36.416037005 +0200 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: fortio -Version: 1.32.0 +Version: 1.32.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.HXdhjV/_old 2022-05-31 15:48:36.448037026 +0200 +++ /var/tmp/diff_new_pack.HXdhjV/_new 2022-05-31 15:48:36.452037029 +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.32.0</param> + <param name="revision">v1.32.2</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> @@ -17,7 +17,7 @@ <param name="compression">gz</param> </service> <service name="go_modules" mode="disabled"> - <param name="archive">fortio-1.32.0.tar.gz</param> + <param name="archive">fortio-1.32.2.tar.gz</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.HXdhjV/_old 2022-05-31 15:48:36.476037044 +0200 +++ /var/tmp/diff_new_pack.HXdhjV/_new 2022-05-31 15:48:36.476037044 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/fortio/fortio</param> - <param name="changesrevision">642dc5ba79194deed3f82eee70b6367e3ab3122e</param></service></servicedata> + <param name="changesrevision">6b4e2d4870971679f0b586ad1082ad0b9fb4b162</param></service></servicedata> (No newline at EOF) ++++++ fortio-1.32.0.tar.gz -> fortio-1.32.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/.github/workflows/main.yml new/fortio-1.32.2/.github/workflows/main.yml --- old/fortio-1.32.0/.github/workflows/main.yml 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/.github/workflows/main.yml 2022-05-26 20:18:23.000000000 +0200 @@ -71,4 +71,6 @@ run: | tag_name="${GITHUB_REF##*/}" echo "tag_name=$tag_name" + # tends to fail and not find the release somehow; add a small sleep... (yuck) + sleep 10 gh release upload "${tag_name}" release/*.{tgz,zip,rpm,deb,gz} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/README.md new/fortio-1.32.2/README.md --- old/fortio-1.32.0/README.md 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/README.md 2022-05-26 20:18:23.000000000 +0200 @@ -52,13 +52,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.32.0/fortio-linux_amd6... \ +curl -L https://github.com/fortio/fortio/releases/download/v1.32.2/fortio-linux_amd6... \ | sudo tar -C / -xvzpf - # or the debian package -wget https://github.com/fortio/fortio/releases/download/v1.32.0/fortio_1.32.0_amd... -dpkg -i fortio_1.32.0_amd64.deb +wget https://github.com/fortio/fortio/releases/download/v1.32.2/fortio_1.32.2_amd... +dpkg -i fortio_1.32.2_amd64.deb # or the rpm -rpm -i https://github.com/fortio/fortio/releases/download/v1.32.0/fortio-1.32.0-1.x... +rpm -i https://github.com/fortio/fortio/releases/download/v1.32.2/fortio-1.32.2-1.x... # and more, see assets in release page ``` @@ -68,7 +68,7 @@ brew install fortio ``` -On Windows, download https://github.com/fortio/fortio/releases/download/v1.32.0/fortio_win_1.32.0... and extract `fortio.exe` to any location, then using the Windows Command Prompt: +On Windows, download https://github.com/fortio/fortio/releases/download/v1.32.2/fortio_win_1.32.2... and extract `fortio.exe` to any location, then using the Windows Command Prompt: ``` fortio.exe server ``` @@ -116,7 +116,7 @@ <details> <!-- use release/updateFlags.sh to update this section --> <pre> -������������ 1.32.0 usage: +������������ 1.32.2 usage: where command is one of: load (load testing), server (starts ui, http-echo, redirect, proxies, tcp-echo and grpc ping servers), tcp-echo (only the tcp-echo server), report (report only UI server), redirect (only the redirect server), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/Webtest.sh new/fortio-1.32.2/Webtest.sh --- old/fortio-1.32.0/Webtest.sh 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/Webtest.sh 2022-05-26 20:18:23.000000000 +0200 @@ -28,7 +28,7 @@ DOCKERSECNAME=fortio_secure_server DOCKERSECVOLNAME=fortio_certs FORTIO_BIN_PATH=fortio # /usr/bin/fortio is the full path but isn't needed -DOCKERID=$(docker run -d --ulimit nofile=$FILE_LIMIT --name $DOCKERNAME fortio/fortio:webtest server -ui-path $FORTIO_UI_PREFIX -loglevel $LOGLEVEL -maxpayloadsizekb $MAXPAYLOAD -timeout=$TIMEOUT) +DOCKERID=$(docker run -d --ulimit nofile=$FILE_LIMIT --net host --name $DOCKERNAME fortio/fortio:webtest server -ui-path $FORTIO_UI_PREFIX -loglevel $LOGLEVEL -maxpayloadsizekb $MAXPAYLOAD -timeout=$TIMEOUT) function cleanup { set +e # errors are ok during cleanup # docker logs "$DOCKERID" # uncomment to debug @@ -36,6 +36,7 @@ docker rm -f $DOCKERNAME docker stop "$DOCKERSECID" # may not be set yet, it's ok docker rm -f $DOCKERSECNAME + docker stop "$DOCKERCURLID" docker rm -f $DOCKERSECVOLNAME } trap cleanup EXIT @@ -117,7 +118,11 @@ PPROF_URL="$BASE_URL/debug/pprof/heap?debug=1" $CURL "$PPROF_URL" | grep -i TotalAlloc # should find this in memory profile # creating dummy container to hold a volume for test certs due to remote docker bind mount limitation. -docker create -v $TEST_CERT_VOL --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v40 /bin/true # cleaned up by name +DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v40 sleep 120) +# while we have something with actual curl binary do +# Test for h2c upgrade (#562) +docker exec $DOCKERSECVOLNAME /usr/bin/curl -v --http2 -m 10 -d foo42 http://localhost:8080/debug | tee >(cat 1>&2) | grep foo42 +# then resume the self signed CA tests # copying cert files into the certs volume of the dummy container for f in ca.crt server.crt server.key; do docker cp "$PWD/cert-tmp/$f" "$DOCKERSECVOLNAME:$TEST_CERT_VOL/$f"; done # start server in secure grpc mode. uses non-default ports to avoid conflicts with fortio_server container. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/codecov.yml new/fortio-1.32.2/codecov.yml --- old/fortio-1.32.0/codecov.yml 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/codecov.yml 2022-05-26 20:18:23.000000000 +0200 @@ -4,3 +4,4 @@ round: nearest # how coverage is rounded: down/up/nearest ignore: # files and folders that will be removed during processing - "**.pb.go" + - "dflag/test_utils.go" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/checksum_test.go new/fortio-1.32.2/dflag/checksum_test.go --- old/fortio-1.32.0/dflag/checksum_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/checksum_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -9,8 +9,11 @@ "time" "fortio.org/fortio/dflag" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" +) + +var ( + assert = dflag.Testify{} + require = assert ) func TestChecksumFlagSet_Differs(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/configmap/updater_test.go new/fortio-1.32.2/dflag/configmap/updater_test.go --- old/fortio-1.32.0/dflag/configmap/updater_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/configmap/updater_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -10,16 +10,12 @@ "os/exec" "path" "path/filepath" - "runtime" "strings" "testing" "time" "fortio.org/fortio/dflag" "fortio.org/fortio/dflag/configmap" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" ) const ( @@ -28,9 +24,14 @@ badStaticDir = "..1289_09_10_03_32_32.039823124" ) -type updaterTestSuite struct { - suite.Suite +var ( + assert = dflag.Testify{} + require = assert + suite = assert +) +type updaterTestSuite struct { + dflag.TestSuite tempDir string flagSet *flag.FlagSet @@ -63,7 +64,7 @@ } func (s *updaterTestSuite) copyTestDataToDir() { - copyCmd := exec.Command("cp", "--archive", "testdata", s.tempDir) + copyCmd := exec.Command("cp", "-a", "testdata", s.tempDir) require.NoError(s.T(), copyCmd.Run(), "copying testdata directory to tempdir must not fail") // We are storing file testdata/9989_09_09_07_32_32.099817316 and renaming it to testdata/..9989_09_09_07_32_32.099817316, // because go modules don't allow repos with files with .. in their filename. See https://github.com/golang/go/issues/27299. @@ -75,7 +76,7 @@ } func (s *updaterTestSuite) linkDataDirTo(newDataDir string) { - copyCmd := exec.Command("ln", "--symbolic", "--no-dereference", "--force", + copyCmd := exec.Command("ln", "-s", "-n", "-f", path.Join(s.tempDir, "testdata", newDataDir), path.Join(s.tempDir, "testdata", "..data")) require.NoError(s.T(), copyCmd.Run(), "relinking ..data in tempdir tempdir must not fail") @@ -97,7 +98,7 @@ func (s *updaterTestSuite) TestInitializeSetsValues() { require.NoError(s.T(), s.updater.Initialize(), "the updater initialize should not return errors on good flags") assert.EqualValues(s.T(), *s.staticInt, 1234, "staticInt should be some_int from first directory") - assert.EqualValues(s.T(), s.dynInt.Get(), 10001, "staticInt should be some_int from first directory") + assert.EqualValues(s.T(), s.dynInt.Get(), int64(10001), "staticInt should be some_int from first directory") } func (s *updaterTestSuite) TestDynamicUpdatesPropagate() { @@ -105,15 +106,12 @@ require.NoError(s.T(), s.updater.Start(), "updater start should not return an error") s.linkDataDirTo(secondGoodDir) eventually(s.T(), 1*time.Second, - assert.ObjectsAreEqualValues, 20002, + assert.ObjectsAreEqualValues, int64(20002), func() interface{} { return s.dynInt.Get() }, "some_dynint value should change to the value from secondGoodDir") } func TestUpdaterSuite(t *testing.T) { - if runtime.GOOS != "linux" { - t.Skipf("Not running on linux (%v), skipping configmap tests", runtime.GOOS) - } suite.Run(t, &updaterTestSuite{}) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynbool_test.go new/fortio-1.32.2/dflag/dynbool_test.go --- old/fortio-1.32.0/dflag/dynbool_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynbool_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -8,8 +8,6 @@ "fmt" "testing" "time" - - "github.com/stretchr/testify/assert" ) func TestDynBool_SetAndGet(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynduration_test.go new/fortio-1.32.2/dflag/dynduration_test.go --- old/fortio-1.32.0/dflag/dynduration_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynduration_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -8,8 +8,6 @@ "fmt" "testing" "time" - - "github.com/stretchr/testify/assert" ) func TestDynDuration_SetAndGet(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynfloat64_test.go new/fortio-1.32.2/dflag/dynfloat64_test.go --- old/fortio-1.32.0/dflag/dynfloat64_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynfloat64_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -7,8 +7,6 @@ "flag" "testing" "time" - - "github.com/stretchr/testify/assert" ) func TestDynFloat64_SetAndGet(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynint64_test.go new/fortio-1.32.2/dflag/dynint64_test.go --- old/fortio-1.32.0/dflag/dynint64_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynint64_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -7,8 +7,6 @@ "flag" "testing" "time" - - "github.com/stretchr/testify/assert" ) func TestDynInt64_SetAndGet(t *testing.T) { @@ -37,8 +35,8 @@ func TestDynInt64_FiresNotifier(t *testing.T) { waitCh := make(chan bool, 1) notifier := func(oldVal int64, newVal int64) { - assert.EqualValues(t, 13371337, oldVal, "old value in notify must match previous value") - assert.EqualValues(t, 77007700, newVal, "new value in notify must match set value") + assert.EqualValues(t, int64(13371337), oldVal, "old value in notify must match previous value") + assert.EqualValues(t, int64(77007700), newVal, "new value in notify must match set value") waitCh <- true } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynjson_test.go new/fortio-1.32.2/dflag/dynjson_test.go --- old/fortio-1.32.0/dflag/dynjson_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynjson_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -8,8 +8,6 @@ "fmt" "testing" "time" - - "github.com/stretchr/testify/assert" ) var defaultJSON = &outerJSON{ @@ -108,7 +106,7 @@ assert.EqualValues(t, defaultJSONArray, dynFlag.Get(), "value must be default after create") - err := set.Set("some_json_array", `[{"ints": [42], "string": "new-value", "inner": { "bool": false } }, + err := set.Set("some_json_array", `[{"ints": [42], "string": "new-value", "inner": { "bool": false } }, {"ints": [24], "string": "new-value", "inner": { "bool": true } }]`) assert.NoError(t, err, "setting value must succeed") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynstring_test.go new/fortio-1.32.2/dflag/dynstring_test.go --- old/fortio-1.32.0/dflag/dynstring_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynstring_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -8,8 +8,6 @@ "regexp" "testing" "time" - - "github.com/stretchr/testify/assert" ) func TestDynString_SetAndGet(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynstringset_test.go new/fortio-1.32.2/dflag/dynstringset_test.go --- old/fortio-1.32.0/dflag/dynstringset_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynstringset_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -7,8 +7,6 @@ "flag" "testing" "time" - - "github.com/stretchr/testify/assert" ) func TestDynStringSet_SetAndGet(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/dynstringslice_test.go new/fortio-1.32.2/dflag/dynstringslice_test.go --- old/fortio-1.32.0/dflag/dynstringslice_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/dynstringslice_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -7,8 +7,6 @@ "flag" "testing" "time" - - "github.com/stretchr/testify/assert" ) func TestDynStringSlice_SetAndGet(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/endpoint/endpoint_test.go new/fortio-1.32.2/dflag/endpoint/endpoint_test.go --- old/fortio-1.32.0/dflag/endpoint/endpoint_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/endpoint/endpoint_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -13,17 +13,20 @@ "testing" "fortio.org/fortio/dflag" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" ) type endpointTestSuite struct { - suite.Suite + dflag.TestSuite flagSet *flag.FlagSet endpoint *FlagsEndpoint } +var ( + assert = dflag.Testify{} + require = assert + suite = assert +) + func TestEndpointTestSuite(t *testing.T) { suite.Run(t, &endpointTestSuite{}) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/fileread_flag_test.go new/fortio-1.32.2/dflag/fileread_flag_test.go --- old/fortio-1.32.0/dflag/fileread_flag_test.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/dflag/fileread_flag_test.go 2022-05-26 20:18:23.000000000 +0200 @@ -6,8 +6,6 @@ import ( "flag" "testing" - - "github.com/stretchr/testify/assert" ) func TestFileFlag_ReadsWithADefault(t *testing.T) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/dflag/test_utils.go new/fortio-1.32.2/dflag/test_utils.go --- old/fortio-1.32.0/dflag/test_utils.go 1970-01-01 01:00:00.000000000 +0100 +++ new/fortio-1.32.2/dflag/test_utils.go 2022-05-26 20:18:23.000000000 +0200 @@ -0,0 +1,151 @@ +// Copyright 2022 Fortio Authors + +// Only in "dflag" for sharing with tests. +// As tests don't fail, coverage of this particular file is poor. + +package dflag + +import ( + "reflect" + "regexp" + "strings" + "testing" +) + +// --- Start of replacement for "github.com/stretchr/testify/assert" + +// require.* and suite.* are used in _test packages while assert is used in dflag itself. +var assert = Testify{} + +// ObjectsAreEqualValues returns true if a == b (through refection). +func (d *Testify) ObjectsAreEqualValues(a, b interface{}) bool { + return reflect.DeepEqual(a, b) +} + +// Testify is a short replacement for github.com/stretchr/testify/assert. +type Testify struct{} + +// NotEqual checks for a not equal b. +func (d *Testify) NotEqual(t *testing.T, a, b interface{}, msg ...string) { + if d.ObjectsAreEqualValues(a, b) { + t.Errorf("%v unexpectedly equal: %v", a, msg) + } +} + +// EqualValues checks for a equal b. +func (d *Testify) EqualValues(t *testing.T, a, b interface{}, msg ...string) { + if !d.ObjectsAreEqualValues(a, b) { + t.Errorf("%v unexpectedly not equal %v: %v", a, b, msg) + } +} + +// Equal also checks for a equal b. +func (d *Testify) Equal(t *testing.T, a, b interface{}, msg ...string) { + d.EqualValues(t, a, b, msg...) +} + +// NoError checks for no errors (nil). +func (d *Testify) NoError(t *testing.T, err error, msg ...string) { + if err != nil { + t.Errorf("expecting no error, got %v: %v", err, msg) + } +} + +// Error checks/expects an error. +func (d *Testify) Error(t *testing.T, err error, msg ...string) { + if err == nil { + t.Errorf("expecting and error, didn't get it: %v", msg) + } +} + +// True checks bool is true. +func (d *Testify) True(t *testing.T, b bool, msg ...string) { + if !b { + t.Errorf("expecting true, didn't: %v", msg) + } +} + +// False checks bool is false. +func (d *Testify) False(t *testing.T, b bool, msg ...string) { + if b { + t.Errorf("expecting false, didn't: %v", msg) + } +} + +// Contains checks that needle is in haystack. +func (d *Testify) Contains(t *testing.T, haystack, needle string, msg ...string) { + if !strings.Contains(haystack, needle) { + t.Errorf("%v doesn't contain %v: %v", haystack, needle, msg) + } +} + +// Fail fails the test. +func (d *Testify) Fail(t *testing.T, msg string) { + t.Fatal(msg) +} + +type hasT interface { + T() *testing.T + SetT(*testing.T) +} + +// TestSuite to be used as base struct for test suites. +type TestSuite struct { + t *testing.T +} + +// T returns the current testing.T. +func (s *TestSuite) T() *testing.T { + return s.t +} + +// SetT sets the testing.T in the suite object. +func (s *TestSuite) SetT(t *testing.T) { + s.t = t +} + +type hasSetupTest interface { + SetupTest() +} +type hasTearDown interface { + TearDownTest() +} + +// Run runs the test suite with SetupTest first and TearDownTest after. +func (d *Testify) Run(t *testing.T, suite hasT) { + suite.SetT(t) + tests := []testing.InternalTest{} + methodFinder := reflect.TypeOf(suite) + var setup hasSetupTest + if s, ok := suite.(hasSetupTest); ok { + setup = s + } + var tearDown hasTearDown + if td, ok := suite.(hasTearDown); ok { + tearDown = td + } + for i := 0; i < methodFinder.NumMethod(); i++ { + method := methodFinder.Method(i) + if ok, _ := regexp.MatchString("^Test", method.Name); !ok { + continue + } + test := testing.InternalTest{ + Name: method.Name, + F: func(t *testing.T) { + method.Func.Call([]reflect.Value{reflect.ValueOf(suite)}) + }, + } + tests = append(tests, test) + } + for _, test := range tests { + if setup != nil { + setup.SetupTest() + } + t.Run(test.Name, test.F) + if tearDown != nil { + tearDown.TearDownTest() + } + } +} + +// --- End of replacement for "github.com/stretchr/testify/assert" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/fhttp/http_client.go new/fortio-1.32.2/fhttp/http_client.go --- old/fortio-1.32.0/fhttp/http_client.go 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/fhttp/http_client.go 2022-05-26 20:18:23.000000000 +0200 @@ -275,7 +275,7 @@ // nolint: noctx // TODO fixme? req, err := http.NewRequest(method, o.URL, body) if err != nil { - log.Errf("Unable to make %s request for %s : %v", method, o.URL, err) + log.Errf("[%d] Unable to make %s request for %s : %v", o.ID, method, o.URL, err) return nil, err } req.Header = o.GenerateHeaders() @@ -287,9 +287,9 @@ } bytes, err := httputil.DumpRequestOut(req, false) if err != nil { - log.Errf("Unable to dump request: %v", err) + log.Errf("[%d] Unable to dump request: %v", o.ID, err) } else { - log.Debugf("For URL %s, sending:\n%s", o.URL, bytes) + log.Debugf("[%d] For URL %s, sending:\n%s", o.ID, o.URL, bytes) } return req, nil } @@ -315,11 +315,11 @@ // Close cleans up any resources used by NewStdClient. func (c *Client) Close() int { - log.Debugf("Close() on %+v", c) + log.Debugf("[%d] Close() on %+v", c.id, c) if c.req != nil { if c.req.Body != nil { if err := c.req.Body.Close(); err != nil { - log.Warnf("Error closing std client body: %v", err) + log.Warnf("[%d] Error closing std client body: %v", c.id, err) } } c.req = nil @@ -375,9 +375,9 @@ var data []byte if log.LogDebug() { if data, err = httputil.DumpResponse(resp, false); err != nil { - log.Errf("Unable to dump response %v", err) + log.Errf("[%d] Unable to dump response %v", c.id, err) } else { - log.Debugf("For URL %s, received:\n%s", c.url, data) + log.Debugf("[%d] For URL %s, received:\n%s", c.id, c.url, data) } } data, err = ioutil.ReadAll(resp.Body) @@ -542,10 +542,10 @@ // Close cleans up any resources used by FastClient. func (c *FastClient) Close() int { - log.Debugf("Closing %p %s socket count %d", c, c.url, c.socketCount) + log.Debugf("[%d] Closing %p %s socket count %d", c.id, c, c.url, c.socketCount) if c.socket != nil { if err := c.socket.Close(); err != nil { - log.Warnf("Error closing fast client's socket: %v", err) + log.Warnf("[%d] Error closing fast client's socket: %v", c.id, err) } c.socket = nil } @@ -582,7 +582,7 @@ // Parse the url, extract components. url, err := url.Parse(urlString) if err != nil { - log.Errf("Bad url '%s' : %v", urlString, err) + log.Errf("[%d] Bad url %q : %v", o.ID, urlString, err) return nil, err } // note: Host includes the port @@ -600,11 +600,11 @@ bc.buffer = make([]byte, BufferSizeKb*1024) if bc.port == "" { bc.port = url.Scheme // ie http which turns into 80 later - log.LogVf("No port specified, using %s", bc.port) + log.LogVf("[%d] No port specified, using %s", bc.id, bc.port) } var addr net.Addr if o.UnixDomainSocket != "" { // nolint: nestif - log.Infof("Using unix domain socket %v instead of %v %v", o.UnixDomainSocket, bc.hostname, bc.port) + log.Infof("[%d] Using unix domain socket %v instead of %v %v", bc.id, o.UnixDomainSocket, bc.hostname, bc.port) uds := &net.UnixAddr{Name: o.UnixDomainSocket, Net: fnet.UnixDomainSocket} addr = uds } else { @@ -662,7 +662,7 @@ bc.uuidMarkers = append(bc.uuidMarkers, []byte(uuidString)) } } - log.Debugf("Created client:\n%+v\n%s", bc.dest, bc.req) + log.Debugf("[%d] Created client:\n%+v\n%s", bc.id, bc.dest, bc.req) return &bc, nil } @@ -716,10 +716,10 @@ return c.returnRes() } } else { - log.Debugf("Reusing socket %v", conn) + log.Debugf("[%d] Reusing socket %v", c.id, c.dest) } c.socket = nil // because of error returns and single retry - conErr := conn.SetReadDeadline(time.Now().Add(c.reqTimeout)) + conErr := conn.SetDeadline(time.Now().Add(c.reqTimeout)) // Send the request: req := c.req if len(c.uuidMarkers) > 0 { @@ -750,7 +750,7 @@ log.Errf("[%d] Unable to close write to %v : %v", c.id, c.dest, err) return c.returnRes() } // else: - log.Debugf("Half closed ok after sending request %v %v", conn, c.dest) + log.Debugf("[%d] Half closed ok after sending request %v", c.id, c.dest) } else { log.Warnf("[%d] Unable to close write non tcp connection %v", c.id, c.dest) } @@ -809,8 +809,8 @@ } c.size += n if log.LogDebug() { - log.Debugf("Read ok %d total %d so far (-%d headers = %d data) %s", - n, c.size, c.headerLen, c.size-c.headerLen, DebugSummary(c.buffer[c.size-n:c.size], 256)) + log.Debugf("[%d] Read ok %d total %d so far (-%d headers = %d data) %s", + c.id, n, c.size, c.headerLen, c.size-c.headerLen, DebugSummary(c.buffer[c.size-n:c.size], 256)) } } skipRead = false @@ -827,8 +827,8 @@ break } if log.LogDebug() { - log.Debugf("Code %d, looking for end of headers at %d / %d, last CRLF %d", - c.code, endofHeadersStart, c.size, c.headerLen) + log.Debugf("[%d] Code %d, looking for end of headers at %d / %d, last CRLF %d", + c.id, c.code, endofHeadersStart, c.size, c.headerLen) } // TODO: keep track of list of newlines to efficiently search headers only there idx := endofHeadersStart @@ -848,7 +848,7 @@ // We have headers ! c.headerLen += 4 // we use this and not endofHeadersStart so http/1.0 does return 0 and not the optimization for search start if log.LogDebug() { - log.Debugf("headers are %d: %s", c.headerLen, c.buffer[:idx]) + log.Debugf("[%d] headers are %d: %q", c.id, c.headerLen, c.buffer[:idx]) } // Find the content length or chunked mode if keepAlive { @@ -864,7 +864,7 @@ } max = c.headerLen + contentLength if log.LogDebug() { // somehow without the if we spend 400ms/10s in LogV (!) - log.Debugf("found content length %d", contentLength) + log.Debugf("[%d] found content length %d", c.id, contentLength) } } else { // Chunked mode (or err/missing): @@ -874,17 +874,17 @@ dataStart, contentLength = ParseChunkSize(c.buffer[c.headerLen:c.size]) if contentLength == -1 { // chunk length not available yet - log.LogVf("chunk mode but no first chunk length yet, reading more") + log.LogVf("[%d] chunk mode but no first chunk length yet, reading more", c.id) max = c.headerLen continue } max = c.headerLen + dataStart + contentLength + 2 // extra CR LF - log.Debugf("chunk-length is %d (%s) setting max to %d", - contentLength, c.buffer[c.headerLen:c.headerLen+dataStart-2], + log.Debugf("[%d] chunk-length is %d (%s) setting max to %d", + c.id, contentLength, c.buffer[c.headerLen:c.headerLen+dataStart-2], max) } else { if log.LogVerbose() { - log.LogVf("Warning: content-length missing in %s", string(c.buffer[:c.headerLen])) + log.LogVf("[%d] Warning: content-length missing in %q", c.id, string(c.buffer[:c.headerLen])) } else { log.Warnf("[%d] Warning: content-length missing (%d bytes headers)", c.id, c.headerLen) } @@ -910,10 +910,10 @@ } // end of big if parse header if c.size >= max { if !keepAlive { - log.Errf("More data is available but stopping after %d, increase -httpbufferkb", max) + log.Errf("[%d] More data is available but stopping after %d, increase -httpbufferkb", c.id, max) } if !parsedHeaders && c.parseHeaders { - log.Errf("Buffer too small (%d) to even finish reading headers, increase -httpbufferkb to get all the data", max) + log.Errf("[%d] Buffer too small (%d) to even finish reading headers, increase -httpbufferkb to get all the data", c.id, max) keepAlive = false } if chunkedMode { @@ -921,24 +921,25 @@ dataStart, nextChunkLen := ParseChunkSize(c.buffer[max:c.size]) if nextChunkLen == -1 { if c.size == max { - log.Debugf("Couldn't find next chunk size, reading more %d %d", max, c.size) + log.Debugf("[%d] Couldn't find next chunk size, reading more %d %d", c.id, max, c.size) } else { - log.Infof("Partial chunk size (%s), reading more %d %d", DebugSummary(c.buffer[max:c.size], 20), max, c.size) + log.Infof("[%d] Partial chunk size (%s), reading more %d %d", c.id, DebugSummary(c.buffer[max:c.size], 20), max, c.size) } continue } else if nextChunkLen == 0 { - log.Debugf("Found last chunk %d %d", max+dataStart, c.size) + log.Debugf("[%d] Found last chunk %d %d", c.id, max+dataStart, c.size) if c.size != max+dataStart+2 || string(c.buffer[c.size-2:c.size]) != "\r\n" { - log.Errf("Unexpected mismatch at the end sz=%d expected %d; end of buffer %q", c.size, max+dataStart+2, c.buffer[max:c.size]) + log.Errf("[%d] Unexpected mismatch at the end sz=%d expected %d; end of buffer %q", + c.id, c.size, max+dataStart+2, c.buffer[max:c.size]) } } else { max += dataStart + nextChunkLen + 2 // extra CR LF - log.Debugf("One more chunk %d -> new max %d", nextChunkLen, max) + log.Debugf("[%d] One more chunk %d -> new max %d", c.id, nextChunkLen, max) if max > len(c.buffer) { - log.Errf("Buffer too small for %d data", max) + log.Errf("[%d] Buffer too small for %d data", c.id, max) } else { if max <= c.size { - log.Debugf("Enough data to reach next chunk, skipping a read") + log.Debugf("[%d] Enough data to reach next chunk, skipping a read", c.id) skipRead = true } continue @@ -955,7 +956,7 @@ if err := conn.Close(); err != nil { log.Errf("[%d] Close error %v %d : %v", c.id, c.dest, c.size, err) } else { - log.Debugf("Closed ok %v from %v after reading %d bytes", conn, c.dest, c.size) + log.Debugf("[%d] Closed ok from %v after reading %d bytes", c.id, c.dest, c.size) } // we cleared c.socket in caller already } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/go.mod new/fortio-1.32.2/go.mod --- old/fortio-1.32.0/go.mod 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/go.mod 2022-05-26 20:18:23.000000000 +0200 @@ -6,17 +6,14 @@ github.com/fsnotify/fsnotify v1.5.4 github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.3.0 - github.com/stretchr/testify v1.7.1 - golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 + golang.org/x/net v0.0.0-20220524220425-1d687d428aca google.golang.org/grpc v1.46.0 ) require ( - github.com/davecgh/go-spew v1.1.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect google.golang.org/protobuf v1.27.1 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.32.0/go.sum new/fortio-1.32.2/go.sum --- old/fortio-1.32.0/go.sum 2022-05-22 06:41:43.000000000 +0200 +++ new/fortio-1.32.2/go.sum 2022-05-26 20:18:23.000000000 +0200 @@ -11,7 +11,6 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -50,15 +49,12 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -74,8 +70,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220524220425-1d687d428aca h1:xTaFYiPROfpPhqrfTIDXj0ri1SpfueYT951s4bAuDO8= +golang.org/x/net v0.0.0-20220524220425-1d687d428aca/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -130,11 +126,11 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= ++++++ vendor.tar.gz ++++++ ++++ 24035 lines of diff (skipped)