From 6327c7403b918c1f6c926ca2681fe0b148d7368c Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Fri, 12 Oct 2018 11:56:42 -0700 Subject: [PATCH] Use fsync instead of sync for test sync sometimes hangs with misbehaving NFS during the tests Signed-off-by: Mrunal Patel --- test/e2e/apps/statefulset.go | 2 +- test/e2e/framework/statefulset_utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/apps/statefulset.go b/test/e2e/apps/statefulset.go index c2254d47cff..626f4652462 100644 --- a/test/e2e/apps/statefulset.go +++ b/test/e2e/apps/statefulset.go @@ -113,7 +113,7 @@ var _ = SIGDescribe("StatefulSet", func() { By("Verifying statefulset set proper service name") framework.ExpectNoError(sst.CheckServiceName(ss, headlessSvcName)) - cmd := "echo $(hostname) > /data/hostname; sync;" + cmd := "echo $(hostname) | dd of=/data/hostname conv=fsync" By("Running " + cmd + " in all stateful pods") framework.ExpectNoError(sst.ExecInStatefulPods(ss, cmd)) diff --git a/test/e2e/framework/statefulset_utils.go b/test/e2e/framework/statefulset_utils.go index b2690b24907..b4f140e4b35 100644 --- a/test/e2e/framework/statefulset_utils.go +++ b/test/e2e/framework/statefulset_utils.go @@ -599,7 +599,7 @@ func (s *StatefulSetTester) ResumeNextPod(ss *apps.StatefulSet) { if resumedPod != "" { Failf("Found multiple paused stateful pods: %v and %v", pod.Name, resumedPod) } - _, err := RunHostCmdWithRetries(pod.Namespace, pod.Name, "touch /data/statefulset-continue; sync", StatefulSetPoll, StatefulPodTimeout) + _, err := RunHostCmdWithRetries(pod.Namespace, pod.Name, "dd if=/dev/zero of=/data/statefulset-continue bs=1 count=1 conv=fsync", StatefulSetPoll, StatefulPodTimeout) ExpectNoError(err) Logf("Resumed pod %v", pod.Name) resumedPod = pod.Name