Skip to contentSkip to conversation

tests/migration: Add some slack to auto converge

PATCH In review Dr. David Alan Gilbert (git) 3 participants 3 messages Feb 10, 2020 – Feb 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/migration: Add some slack to auto converge

From: "Dr. David Alan Gilbert" <[email protected]>

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.

---
 tests/qtest/migration-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/qtest/migration-test.c +2 -1
index cf27ebbc9d..a78ac0c7da 100644
@@ -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");
 
Signature · 1 line
2.24.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

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

Yes, I feel like we're having approximate values here and there in migration code. One simple example is that we calculate bandwidth using sent bytes and timestamps, however our sent bytes should in most cases increase with target page size only (4096 on x86), and then to divide an ~100ms value which changes too from time to time, then everything comes out of these inaccurate numbers could be inaccurate..

Quoted 2 lines

b) That after we make the decision to quit iteration we do one more sync and that sees a few more dirty pages.

True.. I also didn't see how to guarantee the extra 1% will cover this case either...

Quoted 5 lines

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

... But if what we see are always 3K or around then maybe we only need to fixup that special value. Assuming this is for sure going to unbreak tests:

(PS: I would probably remove this check as a whole :)

Quoted 21 lines
---
 tests/qtest/migration-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/qtest/migration-test.c +2 -1
index cf27ebbc9d..a78ac0c7da 100644
@@ -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");
 
Signature · 1 line
2.24.1
Signature · 1 line
Peter Xu
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 12 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

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.

Quoted 4 lines

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

It shouldn't matter really. And if we are seeing that problem.