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
This commit is contained in:
Evans Mungai
2024-03-07 17:19:22 +00:00
committed by GitHub
parent 742e92f1ee
commit d0685ea81a
2 changed files with 12 additions and 5 deletions

View File

@@ -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
@@ -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 {

View File

@@ -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