Skip to content

Commit

Permalink
fix: flaky goldpinger e2e test (#1499)
Browse files Browse the repository at this point in the history
Installing the chart at times takes too long. We'll increase the time
that we wait for the application to be healthy
  • Loading branch information
banjoh authored Mar 7, 2024
1 parent 742e92f commit d0685ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions test/e2e/support-bundle/goldpinger_collector_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Test_GoldpingerCollector(t *testing.T) {
helm.WithNamespace(c.Namespace()),
helm.WithChart(testutils.TestFixtureFilePath(t, "charts/goldpinger-6.0.1.tgz")),
helm.WithWait(),
helm.WithTimeout("1m"),
helm.WithTimeout("2m"),
)
require.NoError(t, err)
return ctx
Expand Down Expand Up @@ -82,8 +82,15 @@ func Test_GoldpingerCollector(t *testing.T) {

// Check that we analysed collected goldpinger results.
// We should expect a single analysis result for goldpinger.
require.Equal(t, 1, len(analysisResults))
assert.Equal(t, 1, len(analysisResults))
if t.Failed() {
t.Logf("Analysis results: %s\n", analysisJSON)
t.Logf("Stdout: %s\n", out.String())
t.Logf("Stderr: %s\n", stdErr.String())
t.FailNow()
}
assert.True(t, strings.HasPrefix(analysisResults[0].Name, "missing.ping.results.for.goldpinger."))

return ctx
}).
Teardown(func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/support-bundle/main_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ func TestMain(m *testing.M) {
}

func getClusterFromContext(t *testing.T, ctx context.Context, clusterName string) *kind.Cluster {
provider, ok := envfuncs.GetClusterFromContext(ctx, ClusterName)
provider, ok := envfuncs.GetClusterFromContext(ctx, clusterName)
if !ok {
t.Fatalf("Failed to extract kind cluster %s from context", ClusterName)
t.Fatalf("Failed to extract kind cluster %s from context", clusterName)
}
cluster, ok := provider.(*kind.Cluster)
if !ok {
t.Fatalf("Failed to cast kind cluster %s from provider", ClusterName)
t.Fatalf("Failed to cast kind cluster %s from provider", clusterName)
}

return cluster
Expand Down

0 comments on commit d0685ea

Please sign in to comment.