Skip to content

Commit

Permalink
DAOS-16686 utils: Remove all pre-read checks from NLT
Browse files Browse the repository at this point in the history
These need to be reworked to be less fragile.

Signed-off-by: Michael MacDonald <[email protected]>
  • Loading branch information
mjmac committed Jan 14, 2025
1 parent 46ccc2f commit 82ddfe2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions utils/node_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Node local test (NLT).
(C) Copyright 2020-2025 Intel Corporation.
(C) Copyright 2025 Google LLC
SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -2354,24 +2355,16 @@ def test_pre_read(self):
# Open a file and read in one go.
with open(join(dfuse.dir, 'file0'), 'r') as fd:
data0 = fd.read()
res = dfuse.check_usage()
assert res['statistics']['pre_read'] == 1, res

# Open a file and read in one go.
with open(join(dfuse.dir, 'file1'), 'r') as fd:
data1 = fd.read(16)
res = dfuse.check_usage(old=res)
assert res['statistics']['pre_read'] == 1, res

# Open a file and read two bytes at a time. Despite disabling buffering python will try and
# read a whole page the first time.
fd = os.open(join(dfuse.dir, 'file2'), os.O_RDONLY)
data2 = os.read(fd, 2)
res = dfuse.check_usage(old=res)
assert res['statistics']['pre_read'] == 1, res
_ = os.read(fd, 2)
res = dfuse.check_usage(old=res)
assert res['statistics']['pre_read'] == 0, res
os.close(fd)

# Open a MB file. This reads 8 128k chunks and 1 EOF.
Expand Down

0 comments on commit 82ddfe2

Please sign in to comment.