File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -282,20 +282,12 @@ def test_os_dup(tmpdir):
282282
283283 try :
284284 with darshan .DarshanReport (path_to_log , filter_patterns = [target_filename ], filter_mode = 'include' ) as report :
285- try :
286- records = report .records [io_module ].to_dict ()
287- if len (records ) > 0 :
288- try :
289- value = records [0 ]["counters" ][key ]
290- print (f"key '{ key } ' has value of '{ value } '" )
291- assert value == 528
292- except KeyError :
293- print (f"Error: record key '{ key } ' was not found." )
294- else :
295- print (f"I/O module '{ io_module } ' for file '{ target_filename } ' has no record" )
296- except KeyError :
297- print (f"I/O module '{ io_module } ' not found" )
298- except KeyError :
299- print (f"I/O module '{ io_module } ' not found" )
285+ # numpy will write the header (128 bytes) out via posix...
286+ posix_records = report .records ["POSIX" ].to_dict ()
287+ # but flush its payload (50 8 byte ints: 400 bytes) with stdio (flush at fclose)
288+ stdio_records = report .records ["STDIO" ].to_dict ()
289+ posix_bytes = posix_records [0 ]["counters" ]["POSIX_BYTES_WRITTEN" ]
290+ stdio_bytes = stdio_records [0 ]["counters" ]["STDIO_BYTES_WRITTEN" ]
291+ assert posix_bytes + stdio_bytes == 528
300292 except RuntimeError :
301293 print (f"Error: The file '{ path_to_log } ' was not found." )
You can’t perform that action at this time.
0 commit comments