Skip to content

Commit

Permalink
tests/migration: Add some slack to auto converge
Browse files Browse the repository at this point in the history
There's an assert in autoconverge that checks that we quit the
iteration when we go below the expected threshold.  Philippe
saw a case where this assert fired with the measured value
slightly over the threshold. (about 3k out of a few million).

I can think of two reasons:
  a) Rounding errors
  b) That after we make the decision to quit iteration we do one
    more sync and that sees a few more dirty pages.

So add 1% slack to the assertion, that should cover a and
most cases of b, probably all we'll see for the test.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
  • Loading branch information
dagrh authored and Juan Quintela committed Feb 13, 2020
1 parent 2a1bc8b commit 6e1f837
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/qtest/migration-test.c
Expand Up @@ -1237,7 +1237,8 @@ static void test_migrate_auto_converge(void)
g_assert_cmpint(percentage, <=, max_pct);

remaining = read_ram_property_int(from, "remaining");
g_assert_cmpint(remaining, <, expected_threshold);
g_assert_cmpint(remaining, <,
(expected_threshold + expected_threshold / 100));

migrate_continue(from, "pre-switchover");

Expand Down

0 comments on commit 6e1f837

Please sign in to comment.