Ticket #308: qp-skip-for-poor-timer-granularity2.patch
File qp-skip-for-poor-timer-granularity2.patch, 2.0 KB (added by , 16 years ago) |
---|
-
queryparsertest.cc
1796 1796 // Allow a factor of 2 difference, to cover random variation. 1797 1797 // First, we test a simple query. 1798 1798 time1 = time_query_parse(db, q1, repetitions, defflags); 1799 if (time1 == 0.0) { 1800 // The first test completed before the timer ticked at all! 1801 SKIP_TEST("Timer granularity is too coarse"); 1802 } 1799 1803 time2 = time_query_parse(db, q2, 1, defflags); 1800 1804 tout << "defflags: small=" << time1 << "s, large=" << time2 << "s\n"; 1801 1805 TEST_LESSER(time2, time1 * 2); … … 1803 1807 // If synonyms are enabled, a different code-path is followed. 1804 1808 // Test a query which has no synonyms. 1805 1809 time1 = time_query_parse(db, q1b, repetitions, synflags); 1810 if (time1 == 0.0) { 1811 // The first test completed before the timer ticked at all! 1812 SKIP_TEST("Timer granularity is too coarse"); 1813 } 1806 1814 time2 = time_query_parse(db, q2b, 1, synflags); 1807 1815 tout << "synflags: small=" << time1 << "s, large=" << time2 << "s\n"; 1808 1816 TEST_LESSER(time2, time1 * 2); 1809 1817 1810 1818 // Test a query which has short synonyms. 1811 1819 time1 = time_query_parse(db, q1, repetitions, synflags); 1820 if (time1 == 0.0) { 1821 // The first test completed before the timer ticked at all! 1822 SKIP_TEST("Timer granularity is too coarse"); 1823 } 1812 1824 time2 = time_query_parse(db, q2, 1, synflags); 1813 1825 tout << "synflags: small=" << time1 << "s, large=" << time2 << "s\n"; 1814 1826 TEST_LESSER(time2, time1 * 2); … … 1818 1830 db.flush(); 1819 1831 1820 1832 time1 = time_query_parse(db, q1, repetitions, synflags); 1833 if (time1 == 0.0) { 1834 // The first test completed before the timer ticked at all! 1835 SKIP_TEST("Timer granularity is too coarse"); 1836 } 1821 1837 time2 = time_query_parse(db, q2, 1, synflags); 1822 1838 tout << "synflags2: small=" << time1 << "s, large=" << time2 << "s\n"; 1823 1839 TEST_LESSER(time2, time1 * 2);