Merge pull request #278 from imjfckm/fix-pp-tests

Fix pp tests
This commit is contained in:
Michal Rakowski 2019-09-20 15:13:41 +02:00 committed by GitHub
commit 3ced3fb9db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -185,7 +185,7 @@ bool nhit_req_should_promote(ocf_promotion_policy_t policy,
uint32_t i; uint32_t i;
uint64_t core_line; uint64_t core_line;
uint64_t occupied_cachelines = uint64_t occupied_cachelines =
ocf_metadata_get_cachelines_count(policy->owner) - ocf_metadata_collision_table_entries(policy->owner) -
ocf_freelist_num_free(policy->owner->freelist); ocf_freelist_num_free(policy->owner->freelist);
if (occupied_cachelines < env_atomic64_read(&ctx->trigger_threshold)) if (occupied_cachelines < env_atomic64_read(&ctx->trigger_threshold))

View File

@ -179,9 +179,8 @@ def fill_cache(cache, fill_ratio):
@pytest.mark.parametrize("fill_percentage", [0, 1, 50, 99]) @pytest.mark.parametrize("fill_percentage", [0, 1, 50, 99])
@pytest.mark.parametrize("insertion_threshold", [2, 8]) @pytest.mark.parametrize("insertion_threshold", [2, 8])
@pytest.mark.parametrize("io_dir", IoDir)
def test_promoted_after_hits_various_thresholds( def test_promoted_after_hits_various_thresholds(
pyocf_ctx, io_dir, insertion_threshold, fill_percentage pyocf_ctx, insertion_threshold, fill_percentage
): ):
""" """
Check promotion policy behavior with various set thresholds Check promotion policy behavior with various set thresholds
@ -230,7 +229,7 @@ def test_promoted_after_hits_various_thresholds(
cache.get_default_queue(), cache.get_default_queue(),
last_core_line, last_core_line,
write_data.size, write_data.size,
io_dir, IoDir.WRITE,
0, 0,
0, 0,
) )
@ -253,13 +252,13 @@ def test_promoted_after_hits_various_thresholds(
comp = OcfCompletion([("error", c_int)]) comp = OcfCompletion([("error", c_int)])
write_data = Data(cache_lines.line_size) write_data = Data(cache_lines.line_size)
io = core.new_io( io = core.new_io(
cache.get_default_queue(), last_core_line, write_data.size, io_dir, 0, 0 cache.get_default_queue(), last_core_line, write_data.size, IoDir.WRITE, 0, 0
) )
io.set_data(write_data) io.set_data(write_data)
io.callback = comp.callback io.callback = comp.callback
io.submit() io.submit()
c.wait() comp.wait()
assert ( assert (
threshold_reached_occupancy threshold_reached_occupancy