Skip to content

Commit d0685ea

Browse files
authored
fix: flaky goldpinger e2e test (#1499)
Installing the chart at times takes too long. We'll increase the time that we wait for the application to be healthy
1 parent 742e92f commit d0685ea

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

test/e2e/support-bundle/goldpinger_collector_e2e_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func Test_GoldpingerCollector(t *testing.T) {
4545
helm.WithNamespace(c.Namespace()),
4646
helm.WithChart(testutils.TestFixtureFilePath(t, "charts/goldpinger-6.0.1.tgz")),
4747
helm.WithWait(),
48-
helm.WithTimeout("1m"),
48+
helm.WithTimeout("2m"),
4949
)
5050
require.NoError(t, err)
5151
return ctx
@@ -82,8 +82,15 @@ func Test_GoldpingerCollector(t *testing.T) {
8282

8383
// Check that we analysed collected goldpinger results.
8484
// We should expect a single analysis result for goldpinger.
85-
require.Equal(t, 1, len(analysisResults))
85+
assert.Equal(t, 1, len(analysisResults))
86+
if t.Failed() {
87+
t.Logf("Analysis results: %s\n", analysisJSON)
88+
t.Logf("Stdout: %s\n", out.String())
89+
t.Logf("Stderr: %s\n", stdErr.String())
90+
t.FailNow()
91+
}
8692
assert.True(t, strings.HasPrefix(analysisResults[0].Name, "missing.ping.results.for.goldpinger."))
93+
8794
return ctx
8895
}).
8996
Teardown(func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {

test/e2e/support-bundle/main_e2e_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ func TestMain(m *testing.M) {
4545
}
4646

4747
func getClusterFromContext(t *testing.T, ctx context.Context, clusterName string) *kind.Cluster {
48-
provider, ok := envfuncs.GetClusterFromContext(ctx, ClusterName)
48+
provider, ok := envfuncs.GetClusterFromContext(ctx, clusterName)
4949
if !ok {
50-
t.Fatalf("Failed to extract kind cluster %s from context", ClusterName)
50+
t.Fatalf("Failed to extract kind cluster %s from context", clusterName)
5151
}
5252
cluster, ok := provider.(*kind.Cluster)
5353
if !ok {
54-
t.Fatalf("Failed to cast kind cluster %s from provider", ClusterName)
54+
t.Fatalf("Failed to cast kind cluster %s from provider", clusterName)
5555
}
5656

5757
return cluster

0 commit comments

Comments
 (0)