Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the timeout for the fips-server start command #33679

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/new-e2e/tests/fips-compliance/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package fipscompliance
import (
"fmt"
"strings"
"testing"
"time"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/components"
Expand All @@ -17,7 +18,6 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)

type cipherTestCase struct {
Expand Down Expand Up @@ -64,12 +64,12 @@ func (s *fipsServer) Start(t *testing.T, tc cipherTestCase) {
require.NoError(c, err)
}
assert.Nil(c, err)
}, 60*time.Second, 20*time.Second)
}, 120*time.Second, 10*time.Second, "docker-compose timed out starting server")

// Wait for container to start and ensure it's a fresh instance
require.EventuallyWithT(t, func(c *assert.CollectT) {
serverLogs, _ := s.dockerHost.Execute("docker logs dd-fips-server")
assert.Contains(c, serverLogs, "Server Starting...", "Server should start")
assert.Contains(c, serverLogs, "Server Starting...", "fips-server timed out waiting for cipher initialization to finish")
assert.Equal(c, 1, strings.Count(serverLogs, "Server Starting..."), "Server should start only once, logs from previous runs should not be present")
}, 60*time.Second, 5*time.Second)
}
Expand Down
6 changes: 4 additions & 2 deletions test/new-e2e/tests/fips-compliance/fips_ciphers_win_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"
"os"
"path/filepath"
"testing"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client"
Expand All @@ -25,8 +26,6 @@ import (
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/components"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"

"testing"

"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -90,6 +89,9 @@ func (s *fipsServerWinSuite) SetupSuite() {
// The connectivity-datadog-core-endpoints diagnoses require a non-empty API key
windowsAgent.WithZeroAPIKey())
require.NoError(s.T(), err)

// Start the fips-server in the Setup step so we pull the image from ghcr.io before a test runs
s.fipsServer.Start()
}

func (s *fipsServerWinSuite) generateTraffic() {
Expand Down
Loading