self.background_procs.append(rproc)
return rproc
- def create_n_files(self, fs_path, count):
+ def create_n_files(self, fs_path, count, sync=False):
assert(self.is_mounted())
abs_path = os.path.join(self.mountpoint, fs_path)
fname = "{{0}}_{{1}}".format(abs_path, i)
h = open(fname, 'w')
h.write('content')
+ if {sync}:
+ h.flush()
+ os.fsync(h.fileno())
h.close()
- """).format(abs_path=abs_path, count=count)
+ """).format(abs_path=abs_path, count=count, sync=str(sync))
self.run_python(pyscript)
self.fs.mds_asok(['config', 'set', 'mds_max_completed_requests', '{0}'.format(max_requests)])
# Create lots of files
- self.mount_a.create_n_files("testdir/file", max_requests + 100)
+ self.mount_a.create_n_files("testdir/file1", max_requests + 100)
+
+ # Create a few files synchronously. This makes sure previous requests are completed
+ self.mount_a.create_n_files("testdir/file2", 5, True)
# Wait for the health warnings. Assume mds can handle 10 request per second at least
self.wait_for_health("failing to advance its oldest client/flush tid", max_requests / 10)