Skip to content

Commit

Permalink
Give more time to nightlies
Browse files Browse the repository at this point in the history
Running our nightlies with race conditions enabled in the integration tests is taking a very long time. This change gives more time to the tests to prevent timing out.
  • Loading branch information
jessejlt committed Jan 6, 2025
1 parent e89a02f commit f852ae0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: sudo apt install -y libsystemd-dev # for collector journal input

- name: Test
run: INTEGRATION=1 ROLLBACK=1 go test -race -mod=vendor -v -timeout=30m ./...
run: INTEGRATION=1 ROLLBACK=1 go test -race -mod=vendor -v -timeout=120m ./...
2 changes: 0 additions & 2 deletions pkg/testutils/alerter/alerter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func Run(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Aler
}

req := testcontainers.ContainerRequest{
Name: "alerter" + testcontainers.SessionID(),
FromDockerfile: testcontainers.FromDockerfile{
Repo: DefaultImage,
Tag: DefaultTag,
Expand All @@ -44,7 +43,6 @@ func Run(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Aler

genericContainerReq := testcontainers.GenericContainerRequest{
ContainerRequest: req,
Reuse: true,
}

for _, opt := range opts {
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutils/alerter/alerter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestAlerter(t *testing.T) {
func TestInCluster(t *testing.T) {
testutils.IntegrationTest(t)

ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
t.Cleanup(cancel)

k3sContainer, err := k3s.Run(ctx, "rancher/k3s:v1.31.2-k3s1")
Expand Down
8 changes: 6 additions & 2 deletions pkg/testutils/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/testcontainers/testcontainers-go/modules/k3s"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kwait "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/yaml"
Expand All @@ -43,7 +44,6 @@ func Run(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Coll
}

req := testcontainers.ContainerRequest{
Name: "collector" + testcontainers.SessionID(),
FromDockerfile: testcontainers.FromDockerfile{
Repo: DefaultImage,
Tag: DefaultTag,
Expand All @@ -55,7 +55,6 @@ func Run(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Coll

genericContainerReq := testcontainers.GenericContainerRequest{
ContainerRequest: req,
Reuse: true,
}

for _, opt := range opts {
Expand Down Expand Up @@ -175,6 +174,11 @@ func WithCluster(ctx context.Context, k *k3s.K3sContainer) testcontainers.Custom
}

if err := ctrlCli.Create(ctx, collectorFunction); err != nil {
if meta.IsNoMatchError(err) {
// Ingestor installs the CRD, so if we get a no match error, it's because the CRD
// hasn't been installed yet. We can just skip creating the function in this case.
return nil
}
return fmt.Errorf("failed to create collector function: %w", err)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/testutils/collector/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func TestCollector(t *testing.T) {
testutils.IntegrationTest(t)

ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
defer cancel()

t.Run("outside cluster", func(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions pkg/testutils/ingestor/ingestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func Run(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Inge
}

req := testcontainers.ContainerRequest{
Name: "ingestor" + testcontainers.SessionID(),
FromDockerfile: testcontainers.FromDockerfile{
Repo: DefaultImage,
Tag: DefaultTag,
Expand All @@ -54,7 +53,6 @@ func Run(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Inge

genericContainerReq := testcontainers.GenericContainerRequest{
ContainerRequest: req,
Reuse: true,
}

for _, opt := range opts {
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutils/ingestor/ingestor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func TestIngestor(t *testing.T) {
testutils.IntegrationTest(t)

ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
defer cancel()

t.Run("outside cluster", func(t *testing.T) {
Expand Down

0 comments on commit f852ae0

Please sign in to comment.