Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest pytest-xdist
- name: 'Build OCF library'
run: cd tests/functional; make -j
- name: 'Execute tests'
run: cd tests/functional; python3 -m pytest
run: cd tests/functional; python3 -m pytest -n auto
4 changes: 2 additions & 2 deletions .github/workflows/tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest pytest-xdist
- name: 'Build OCF library'
run: cd tests/functional; make -j
- name: 'Execute tests'
run: cd tests/functional; python3 -m pytest
run: cd tests/functional; python3 -m pytest -n auto
3 changes: 3 additions & 0 deletions tests/functional/tests/engine/test_d2c.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2024 Huawei Technologies
# Copyright(c) 2026 Unvertical
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -68,6 +69,7 @@ def test_d2c_io(pyocf_ctx):
c.results["error"],
)

cache.settle()
assert cache.get_stats()["req"]["wr_pt"]["value"] == 2

read_io = vol.new_io(queue, 0, CORE_SIZE, IoDir.READ, 0, 0)
Expand All @@ -76,6 +78,7 @@ def test_d2c_io(pyocf_ctx):

read_completion = Sync(read_io).submit()
assert int(read_completion.results["err"]) == 0
cache.settle()
assert cache.get_stats()["req"]["rd_full_misses"]["value"] == 1

cache.stop()
Expand Down
1 change: 1 addition & 0 deletions tests/functional/tests/engine/test_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def test_partial_hit_promotion(pyocf_ctx):
# Step 2
r = Rio().readwrite(ReadWrite.READ).bs(Size(512)).size(Size(512)).target(vol).run([queue])

cache.settle()
stats = cache.get_stats()
cache_lines = stats["conf"]["size"]
assert stats["usage"]["occupancy"]["value"] == 1
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/tests/engine/test_prefetch_readahead.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_prefetch_readahead_threshold(pyocf_ctx, threshold, req_size, cls):
rio = (Rio().target(vol).bs(req_size).size(below_size)
.readwrite(ReadWrite.READ))
rio.run([queue])
queue.settle()
cache.settle()

assert get_prefetch_count(cache) == 0, \
"No prefetch should trigger below threshold"
Expand All @@ -113,7 +113,7 @@ def test_prefetch_readahead_threshold(pyocf_ctx, threshold, req_size, cls):
rio = (Rio().target(vol).bs(req_size).size(req_size).offset(below_size)
.readwrite(ReadWrite.READ))
rio.run([queue])
queue.settle()
cache.settle()

assert get_prefetch_count(cache) == 1, \
"Exactly one prefetch request should be generated"
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_prefetch_readahead_random(pyocf_ctx, cls):
rio = (Rio().target(vol).bs(Size.from_KiB(4)).size(Size.from_MiB(20))
.readwrite(ReadWrite.RANDREAD))
rio.run([queue])
queue.settle()
cache.settle()

assert get_prefetch_count(cache) == 0, \
"No prefetch should trigger for random reads"
Expand Down Expand Up @@ -176,7 +176,7 @@ def test_prefetch_readahead_read_insert(pyocf_ctx, cache_mode, cls):
rio = (Rio().target(vol).bs(Size.from_KiB(4)).size(Size.from_MiB(1))
.readwrite(ReadWrite.READ))
rio.run([queue])
queue.settle()
cache.settle()

assert get_prefetch_count(cache) > 0, \
f"Prefetch should trigger in {cache_mode.name} mode"
Expand Down Expand Up @@ -208,7 +208,7 @@ def test_prefetch_readahead_no_read_insert(pyocf_ctx, cache_mode, cls):
rio = (Rio().target(vol).bs(Size.from_KiB(4)).size(Size.from_MiB(1))
.readwrite(ReadWrite.READ))
rio.run([queue])
queue.settle()
cache.settle()

assert get_prefetch_count(cache) == 0, \
f"No prefetch should trigger in {cache_mode.name} mode"
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/tests/eviction/test_eviction.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def test_write_size_greater_than_cache(pyocf_ctx, mode: CacheMode, cls: CacheLin
test_data = Data(valid_io_size)
send_io(vol, test_data)

cache.settle()
stats = core.cache.get_stats()
first_block_sts = stats["block"]
first_usage_sts = stats["usage"]
Expand All @@ -94,6 +95,7 @@ def test_write_size_greater_than_cache(pyocf_ctx, mode: CacheMode, cls: CacheLin
if mode is not CacheMode.WT:
# Flush first write
cache.flush()
cache.settle()
stats = core.cache.get_stats()
second_block_sts = stats["block"]
second_usage_sts = stats["usage"]
Expand Down Expand Up @@ -146,6 +148,7 @@ def test_eviction_priority_1(pyocf_ctx, cls: CacheLineSize, cache_mode: CacheMod
)

def get_ioclass_occupancy(cache, ioclass_id):
cache.settle()
return cache.get_ioclass_stats(ioclass_id)["usage"]["occupancy"]["value"]

cache.set_seq_cut_off_policy(SeqCutOffPolicy.NEVER)
Expand Down Expand Up @@ -214,6 +217,7 @@ def test_eviction_priority_2(pyocf_ctx, cls: CacheLineSize, cache_mode: CacheMod
)

def get_ioclass_occupancy(cache, ioclass_id):
cache.settle()
return cache.get_ioclass_stats(ioclass_id)["usage"]["occupancy"]["value"]

cache.set_seq_cut_off_policy(SeqCutOffPolicy.NEVER)
Expand Down
3 changes: 3 additions & 0 deletions tests/functional/tests/security/test_secure_erase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
# Copyright(c) 2019-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies
# Copyright(c) 2026 Unvertical
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -114,6 +115,7 @@ def test_secure_erase_simple_io_read_misses(cache_mode):
Sync(io).submit()

vol.close()
cache.settle()
stats = cache.get_stats()

ctx.exit()
Expand Down Expand Up @@ -171,6 +173,7 @@ def test_secure_erase_simple_io_cleaning():
Sync(io).submit()

vol.close()
cache.settle()
stats = cache.get_stats()

ctx.exit()
Expand Down
Loading