浏览代码

integration/TestDaemonProxy: Remove OTEL span

Don't use OTEL tracing in this test because we're testing the HTTP proxy
behavior here and we don't want OTEL to interfere.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 1 年之前
父节点
当前提交
56aeb548b2
共有 1 个文件被更改,包括 4 次插入7 次删除
  1. 4 7
      integration/daemon/daemon_test.go

+ 4 - 7
integration/daemon/daemon_test.go

@@ -2,6 +2,7 @@ package daemon // import "github.com/docker/docker/integration/daemon"
 
 
 import (
 import (
 	"bytes"
 	"bytes"
+	"context"
 	"fmt"
 	"fmt"
 	"io"
 	"io"
 	"net/http"
 	"net/http"
@@ -182,7 +183,9 @@ func TestConfigDaemonSeccompProfiles(t *testing.T) {
 func TestDaemonProxy(t *testing.T) {
 func TestDaemonProxy(t *testing.T) {
 	skip.If(t, runtime.GOOS == "windows", "cannot start multiple daemons on windows")
 	skip.If(t, runtime.GOOS == "windows", "cannot start multiple daemons on windows")
 	skip.If(t, os.Getenv("DOCKER_ROOTLESS") != "", "cannot connect to localhost proxy in rootless environment")
 	skip.If(t, os.Getenv("DOCKER_ROOTLESS") != "", "cannot connect to localhost proxy in rootless environment")
-	ctx := testutil.StartSpan(baseContext, t)
+
+	// Don't setup OTEL here to avoid it hitting the HTTP proxy.
+	ctx := context.Background()
 
 
 	newProxy := func(rcvd *string, t *testing.T) *httptest.Server {
 	newProxy := func(rcvd *string, t *testing.T) *httptest.Server {
 		s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -200,7 +203,6 @@ func TestDaemonProxy(t *testing.T) {
 	t.Run("environment variables", func(t *testing.T) {
 	t.Run("environment variables", func(t *testing.T) {
 		t.Parallel()
 		t.Parallel()
 
 
-		ctx := testutil.StartSpan(ctx, t)
 		var received string
 		var received string
 		proxyServer := newProxy(&received, t)
 		proxyServer := newProxy(&received, t)
 
 
@@ -233,8 +235,6 @@ func TestDaemonProxy(t *testing.T) {
 	t.Run("command-line options", func(t *testing.T) {
 	t.Run("command-line options", func(t *testing.T) {
 		t.Parallel()
 		t.Parallel()
 
 
-		ctx := testutil.StartSpan(ctx, t)
-
 		var received string
 		var received string
 		proxyServer := newProxy(&received, t)
 		proxyServer := newProxy(&received, t)
 
 
@@ -283,7 +283,6 @@ func TestDaemonProxy(t *testing.T) {
 	// Configure proxy through configuration file
 	// Configure proxy through configuration file
 	t.Run("configuration file", func(t *testing.T) {
 	t.Run("configuration file", func(t *testing.T) {
 		t.Parallel()
 		t.Parallel()
-		ctx := testutil.StartSpan(ctx, t)
 
 
 		var received string
 		var received string
 		proxyServer := newProxy(&received, t)
 		proxyServer := newProxy(&received, t)
@@ -332,7 +331,6 @@ func TestDaemonProxy(t *testing.T) {
 
 
 	// Conflicting options (passed both through command-line options and config file)
 	// Conflicting options (passed both through command-line options and config file)
 	t.Run("conflicting options", func(t *testing.T) {
 	t.Run("conflicting options", func(t *testing.T) {
-		ctx := testutil.StartSpan(ctx, t)
 		const (
 		const (
 			proxyRawURL = "https://" + userPass + "example.org"
 			proxyRawURL = "https://" + userPass + "example.org"
 			proxyURL    = "https://xxxxx:xxxxx@example.org"
 			proxyURL    = "https://xxxxx:xxxxx@example.org"
@@ -357,7 +355,6 @@ func TestDaemonProxy(t *testing.T) {
 	// Make sure values are sanitized when reloading the daemon-config
 	// Make sure values are sanitized when reloading the daemon-config
 	t.Run("reload sanitized", func(t *testing.T) {
 	t.Run("reload sanitized", func(t *testing.T) {
 		t.Parallel()
 		t.Parallel()
-		ctx := testutil.StartSpan(ctx, t)
 
 
 		const (
 		const (
 			proxyRawURL = "https://" + userPass + "example.org"
 			proxyRawURL = "https://" + userPass + "example.org"