File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -516,8 +516,10 @@ diskspd_single_thread_latency:
516516 name : diskspd
517517 flags : &diskspd_single_thread_latency_flags
518518 num_striped_disks : 1
519- data_disk_size : 500
520- diskspd_file_size : 400G
519+ data_disk_size : 1024
520+ diskspd_file_size : 1000G
521+ provisioned_iops : 16000
522+ provisioned_throughput : 1000
521523 diskspd_thread_number_per_file : 1
522524 diskspd_outstanding_io : 1
523525 diskspd_block_size : 8k
Original file line number Diff line number Diff line change @@ -487,8 +487,9 @@ def Prefill(running_vm):
487487
488488
489489def RunDiskspdPrefillCommandForDuration (vm , diskspd_exe_dir , prefill_duration ):
490+ # using -si so that all the threads share the same offset and don't overlap.
490491 diskspd_options = (
491- f'-c{ FLAGS .diskspd_file_size } -t16 -w100'
492+ f'-c{ FLAGS .diskspd_file_size } -t16 -w100 -si '
492493 f' -b{ DISKSPD_PREFILL_BLOCK_SIZE .value } -d{ prefill_duration } -Rxml -Sh'
493494 f' -o16 -Zr C:\\ scratch\\ { DISKSPD_TMPFILE } > { DISKSPD_XMLFILE } '
494495 )
Original file line number Diff line number Diff line change 1616
1717import os
1818import unittest
19+ from unittest import mock
1920import xml .etree .ElementTree as ET
2021
2122from absl import flags
@@ -184,6 +185,26 @@ def testGenerateDiskspdConfigBooleans(self):
184185 self .assertIn ('-l' , config )
185186 self .assertIn ('-n' , config )
186187
188+ @flagsaver .flagsaver (diskspd_file_size = '1G' , diskspd_prefill_block_size = '1M' )
189+ def testRunDiskspdPrefillCommandForDuration (self ):
190+ vm = mock .Mock ()
191+ with mock .patch .object (
192+ diskspd , '_CatXml' , return_value = '<xml>result</xml>'
193+ ) as cat_xml_mock :
194+ with mock .patch .object (diskspd , '_RemoveXml' ) as remove_xml_mock :
195+ result = diskspd .RunDiskspdPrefillCommandForDuration (
196+ vm , '/tmp/x86' , 100
197+ )
198+ self .assertEqual (result , '<xml>result</xml>' )
199+ command = (
200+ 'cd /tmp/x86; .\\ diskspd.exe -c1G -t16 -w100 -si -b1M -d100 -Rxml'
201+ f' -Sh -o16 -Zr C:\\ scratch\\ { diskspd .DISKSPD_TMPFILE } >'
202+ f' { diskspd .DISKSPD_XMLFILE } '
203+ )
204+ vm .RobustRemoteCommand .assert_called_with (command )
205+ cat_xml_mock .assert_called_with (vm )
206+ remove_xml_mock .assert_called_with (vm )
207+
187208
188209if __name__ == '__main__' :
189210 unittest .main ()
You can’t perform that action at this time.
0 commit comments