From 60ebb9394d7828f2ac42b821e823ba5a83d9f7df Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Fri, 5 Aug 2022 13:07:21 -0700 Subject: [PATCH] testing: add test for slat + clat = tlat The sum of submission and completion latency should equal total latency. Add a test case for this for the libaio ioengine. Signed-off-by: Vincent Fu --- t/jobs/t0015-e78980ff.fio | 7 +++++++ t/run-fio-tests.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 t/jobs/t0015-e78980ff.fio diff --git a/t/jobs/t0015-e78980ff.fio b/t/jobs/t0015-e78980ff.fio new file mode 100644 index 00000000..c650c0b2 --- /dev/null +++ b/t/jobs/t0015-e78980ff.fio @@ -0,0 +1,7 @@ +# Expected result: mean(slat) + mean(clat) = mean(lat) +# Buggy result: equality does not hold + +[test] +ioengine=libaio +size=1M +iodepth=16 diff --git a/t/run-fio-tests.py b/t/run-fio-tests.py index 32cdbc19..7a2e1f41 100755 --- a/t/run-fio-tests.py +++ b/t/run-fio-tests.py @@ -527,6 +527,27 @@ class FioJobTest_t0014(FioJobTest): return +class FioJobTest_t0015(FioJobTest): + """Test consists of fio test job t0015 + Confirm that mean(slat) + mean(clat) = mean(tlat)""" + + def check_result(self): + super(FioJobTest_t0015, self).check_result() + + if not self.passed: + return + + slat = self.json_data['jobs'][0]['read']['slat_ns']['mean'] + clat = self.json_data['jobs'][0]['read']['clat_ns']['mean'] + tlat = self.json_data['jobs'][0]['read']['lat_ns']['mean'] + logging.debug('Test %d: slat %f, clat %f, tlat %f', self.testnum, slat, clat, tlat) + + if abs(slat + clat - tlat) > 1: + self.failure_reason = "{0} slat {1} + clat {2} = {3} != tlat {4},".format( + self.failure_reason, slat, clat, slat+clat, tlat) + self.passed = False + + class FioJobTest_iops_rate(FioJobTest): """Test consists of fio test job t0009 Confirm that job0 iops == 1000 @@ -816,6 +837,16 @@ TEST_LIST = [ 'output_format': 'json', 'requirements': [], }, + { + 'test_id': 15, + 'test_class': FioJobTest_t0015, + 'job': 't0015-e78980ff.fio', + 'success': SUCCESS_DEFAULT, + 'pre_job': None, + 'pre_success': None, + 'output_format': 'json', + 'requirements': [Requirements.linux, Requirements.libaio], + }, { 'test_id': 1000, 'test_class': FioExeTest, -- 2.25.1