#At file:///home/malff/BZR_TREE/mysql-trunk-perfschema/ based on revid:marc.alff@stripped
2957 Marc Alff 2009-11-17
Bug#48631 Performance schema: unit test failures
Simplified the unit test, some parts can not be automated.
modified:
storage/perfschema/unittest/pfs_timer-t.cc
=== modified file 'storage/perfschema/unittest/pfs_timer-t.cc'
--- a/storage/perfschema/unittest/pfs_timer-t.cc 2009-11-09 22:06:45 +0000
+++ b/storage/perfschema/unittest/pfs_timer-t.cc 2009-11-17 15:14:40 +0000
@@ -29,8 +29,6 @@ void test_timers()
ulonglong t3_b;
ulonglong t4_b;
ulonglong t5_b;
- ulonglong five_sec_in_pico_low;
- ulonglong five_sec_in_pico_high;
init_timers();
@@ -55,10 +53,10 @@ void test_timers()
my_sleep(5000000);
t5_b= get_timer_value(TIMER_NAME_TICK);
- /* Checking we are within a 1/1000 range */
- five_sec_in_pico_low= (ulonglong) (5*1e12 * 0.999);
- five_sec_in_pico_high= (ulonglong) (5*1e12 * 1.001);
-
+ /*
+ Print the timer values, for manual inspection by a human.
+ Tests involving low level timers can not be automated.
+ */
diag("cycle a: %13llu", t1_a);
diag("nano a: %13llu", t2_a);
diag("micro a: %13llu", t3_a);
@@ -78,57 +76,29 @@ void test_timers()
diag("tick b-a: %13llu", t5_b-t5_a);
if ((t1_a == 0) && (t1_b == 0))
- {
- skip(3, "cycle timer not implemented");
- }
+ skip(1, "cycle timer not implemented");
else
- {
ok(t1_b > t1_a, "cycle timer ascending");
- ok(t1_b - t1_a >= five_sec_in_pico_low, "cycle timer count >= low limit");
- ok(t1_b - t1_a <= five_sec_in_pico_high, "cycle timer count <= high limit");
- }
if ((t2_a == 0) && (t2_b == 0))
- {
- skip(3, "nano timer not implemented");
- }
+ skip(1, "nano timer not implemented");
else
- {
ok(t2_b > t2_a, "nano timer ascending");
- ok(t2_b - t2_a >= five_sec_in_pico_low, "nano timer count >= low limit");
- ok(t2_b - t2_a <= five_sec_in_pico_high, "nano timer count <= high limit");
- }
if ((t3_a == 0) && (t3_b == 0))
- {
- skip(3, "micro timer not implemented");
- }
+ skip(1, "micro timer not implemented");
else
- {
ok(t3_b > t3_a, "micro timer ascending");
- ok(t3_b - t3_a >= five_sec_in_pico_low, "micro timer count >= low limit");
- ok(t3_b - t3_a <= five_sec_in_pico_high, "micro timer count <= high limit");
- }
if ((t4_a == 0) && (t4_b == 0))
- {
skip(1, "milli timer not implemented");
- }
else
- {
ok(t4_b > t4_a, "milli timer ascending");
- /* Timer too inaccurate to have a reliable test */
- }
if ((t5_a == 0) && (t5_b == 0))
- {
skip(1, "tick timer not implemented");
- }
else
- {
ok(t5_b > t5_a, "tick timer ascending");
- /* Timer too inaccurate to have a reliable test */
- }
}
void do_all_tests()
@@ -138,7 +108,7 @@ void do_all_tests()
int main(int, char **)
{
- plan(11);
+ plan(5);
MY_INIT("pfs_timer-t");
do_all_tests();
return 0;
Attachment: [text/bzr-bundle] bzr/marc.alff@sun.com-20091117151440-2rxrblz3yin2pw23.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk-perfschema branch (marc.alff:2957) Bug#48631 | Marc Alff | 17 Nov |