tags 954534 + patch upstream fixed-upstream thanks
This error appears within the testsuite. It's specific to golang 1.14+ and is already known and fixed upstream [1] in version v1.6.0. Attached you will find a patch for version v1.2.1 (currently in debian). While the attached patch will fix this bug it might be a better solution to package the latest upstream release (v1.6.0) which already contains the bugfix. However, I've tried to upgrade the package and it failed. I guess some dependencies needs to be upgraded as well. [1]: https://github.com/prometheus/client_golang/pull/740/commits/af6ade7230522a649b315c041cb74a301d6360e7 Cheers, - Adrian
diff --git a/debian/patches/02-Bug954534-Fix-unit-test-failing-with-Go1.14.patch b/debian/patches/02-Bug954534-Fix-unit-test-failing-with-Go1.14.patch new file mode 100644 index 0000000..b0def6b --- /dev/null +++ b/debian/patches/02-Bug954534-Fix-unit-test-failing-with-Go1.14.patch @@ -0,0 +1,37 @@ +From: Adrian Vondendriesch <adrian.vondendrie...@credativ.de> +Date: Sat, 16 May 2020 16:48:21 +0200 +Subject: Fix unit test failing with Go1.14+ + +Import Upstream patch. Issue: #740. +--- + prometheus/promhttp/instrument_client_test.go | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/prometheus/promhttp/instrument_client_test.go b/prometheus/promhttp/instrument_client_test.go +index 50d64bd..aab8dbe 100644 +--- a/prometheus/promhttp/instrument_client_test.go ++++ b/prometheus/promhttp/instrument_client_test.go +@@ -15,10 +15,10 @@ package promhttp + + import ( + "context" +- "fmt" + "log" + "net/http" + "net/http/httptest" ++ "strings" + "testing" + "time" + +@@ -186,8 +186,9 @@ func TestClientMiddlewareAPIWithRequestContextTimeout(t *testing.T) { + if err == nil { + t.Fatal("did not get timeout error") + } +- if want, got := fmt.Sprintf("Get %s: context deadline exceeded", backend.URL), err.Error(); want != got { +- t.Fatalf("want error %q, got %q", want, got) ++ expectedMsg := "context deadline exceeded" ++ if !strings.Contains(err.Error(), expectedMsg) { ++ t.Fatalf("unexpected error: %q, expect error: %q", err.Error(), expectedMsg) + } + } + diff --git a/debian/patches/series b/debian/patches/series index 4059616..a376b49 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 01-Bug854687-Disable_flaky_test.patch +02-Bug954534-Fix-unit-test-failing-with-Go1.14.patch
0x61F7985DB84E0B04.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature