Skip to content

e2e: fpga: fix intermittent failures #1639

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

Merged
merged 1 commit into from
Jan 5, 2024
Merged
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
20 changes: 16 additions & 4 deletions test/e2e/fpga/fpga.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func runDevicePlugin(ctx context.Context, fmw *framework.Framework, pluginKustom
ginkgo.By("deploying mappings")
e2ekubectl.RunKubectlOrDie(fmw.Namespace.Name, "apply", "-f", mappingsCollectionPath)

waitForPod(ctx, fmw, "intel-fpga-plugin")
waitForPluginAndWebhook(ctx, fmw)

resource := v1.ResourceName(nodeResource)

Expand Down Expand Up @@ -189,11 +189,11 @@ func createPod(ctx context.Context, fmw *framework.Framework, name string, resou
return pod
}

func waitForPod(ctx context.Context, fmw *framework.Framework, name string) {
ginkgo.By(fmt.Sprintf("waiting for %s availability", name))
func waitForPluginAndWebhook(ctx context.Context, fmw *framework.Framework) {
ginkgo.By("waiting for intel-fpga-plugin availability")

podList, err := e2epod.WaitForPodsWithLabelRunningReady(ctx, fmw.ClientSet, fmw.Namespace.Name,
labels.Set{"app": name}.AsSelector(), 1, 100*time.Second)
labels.Set{"app": "intel-fpga-plugin"}.AsSelector(), 1, 100*time.Second)
if err != nil {
e2edebug.DumpAllNamespaceInfo(ctx, fmw.ClientSet, fmw.Namespace.Name)
e2ekubectl.LogFailedContainers(ctx, fmw.ClientSet, fmw.Namespace.Name, framework.Logf)
Expand All @@ -205,4 +205,16 @@ func waitForPod(ctx context.Context, fmw *framework.Framework, name string) {
if err = utils.TestPodsFileSystemInfo(podList.Items); err != nil {
framework.Failf("container filesystem info checks failed: %v", err)
}

ginkgo.By("waiting for webhook availability")

_, err = e2epod.WaitForPodsWithLabelRunningReady(ctx, fmw.ClientSet, fmw.Namespace.Name,
labels.Set{"control-plane": "controller-manager"}.AsSelector(), 1, 100*time.Second)
if err != nil {
e2edebug.DumpAllNamespaceInfo(ctx, fmw.ClientSet, fmw.Namespace.Name)
e2ekubectl.LogFailedContainers(ctx, fmw.ClientSet, fmw.Namespace.Name, framework.Logf)
framework.Failf("unable to wait for all pods to be running and ready: %v", err)
}

ginkgo.By("all pods found")
}