Skip to content

Commit

Permalink
WT-1481 Fix statistics name usage in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sueloverso committed Aug 3, 2015
1 parent aa3257d commit ec69f4e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
20 changes: 18 additions & 2 deletions test/suite/test_sweep01.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def test_ops(self):
time.sleep(1)

stat_cursor = self.session.open_cursor('statistics:', None, None)
close1 = stat_cursor[stat.conn.dh_conn_handles][2]
close1 = stat_cursor[stat.conn.dh_conn_handles_closed][2]
remove1 = stat_cursor[stat.conn.dh_conn_handles_removed][2]
sweep1 = stat_cursor[stat.conn.dh_conn_sweeps][2]
sclose1 = stat_cursor[stat.conn.dh_session_handles][2]
ssweep1 = stat_cursor[stat.conn.dh_session_sweeps][2]
Expand Down Expand Up @@ -127,7 +128,8 @@ def test_ops(self):
c.close()

stat_cursor = self.session.open_cursor('statistics:', None, None)
close2 = stat_cursor[stat.conn.dh_conn_handles][2]
close2 = stat_cursor[stat.conn.dh_conn_handles_closed][2]
remove2 = stat_cursor[stat.conn.dh_conn_handles_removed][2]
sweep2 = stat_cursor[stat.conn.dh_conn_sweeps][2]
sclose2 = stat_cursor[stat.conn.dh_session_handles][2]
ssweep2 = stat_cursor[stat.conn.dh_session_sweeps][2]
Expand All @@ -150,15 +152,27 @@ def test_ops(self):
#
if (close1 >= close2):
print "XX: close1: " + str(close1) + " close2: " + str(close2)
print "remove1: " + str(remove1) + " remove2: " + str(remove2)
print "sweep1: " + str(sweep1) + " sweep2: " + str(sweep2)
print "sclose1: " + str(sclose1) + " sclose2: " + str(sclose2)
print "ssweep1: " + str(ssweep1) + " ssweep2: " + str(ssweep2)
print "tod1: " + str(tod1) + " tod2: " + str(tod2)
print "ref1: " + str(ref1) + " ref2: " + str(ref2)
print "nfile1: " + str(nfile1) + " nfile2: " + str(nfile2)
self.assertEqual(close1 < close2, True)
#if (remove1 >= remove2):
# print "close1: " + str(close1) + " close2: " + str(close2)
# print "XX: remove1: " + str(remove1) + " remove2: " + str(remove2)
# print "sweep1: " + str(sweep1) + " sweep2: " + str(sweep2)
# print "sclose1: " + str(sclose1) + " sclose2: " + str(sclose2)
# print "ssweep1: " + str(ssweep1) + " ssweep2: " + str(ssweep2)
# print "tod1: " + str(tod1) + " tod2: " + str(tod2)
# print "ref1: " + str(ref1) + " ref2: " + str(ref2)
# print "nfile1: " + str(nfile1) + " nfile2: " + str(nfile2)
#self.assertEqual(remove1 < remove2, True)
if (sweep1 >= sweep2):
print "close1: " + str(close1) + " close2: " + str(close2)
print "remove1: " + str(remove1) + " remove2: " + str(remove2)
print "XX: sweep1: " + str(sweep1) + " sweep2: " + str(sweep2)
print "sclose1: " + str(sclose1) + " sclose2: " + str(sclose2)
print "ssweep1: " + str(ssweep1) + " ssweep2: " + str(ssweep2)
Expand All @@ -167,6 +181,7 @@ def test_ops(self):
self.assertEqual(sweep1 < sweep2, True)
if (nfile2 >= nfile1):
print "close1: " + str(close1) + " close2: " + str(close2)
print "remove1: " + str(remove1) + " remove2: " + str(remove2)
print "sweep1: " + str(sweep1) + " sweep2: " + str(sweep2)
print "sclose1: " + str(sclose1) + " sclose2: " + str(sclose2)
print "ssweep1: " + str(ssweep1) + " ssweep2: " + str(ssweep2)
Expand All @@ -178,6 +193,7 @@ def test_ops(self):
# and the active file.
if (nfile2 != 3):
print "close1: " + str(close1) + " close2: " + str(close2)
print "remove1: " + str(remove1) + " remove2: " + str(remove2)
print "sweep1: " + str(sweep1) + " sweep2: " + str(sweep2)
print "sclose1: " + str(sclose1) + " sclose2: " + str(sclose2)
print "ssweep1: " + str(ssweep1) + " ssweep2: " + str(ssweep2)
Expand Down
8 changes: 4 additions & 4 deletions test/suite/test_sweep03.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_disable_idle_timeout1(self):
time.sleep(5)

stat_cursor = self.session.open_cursor('statistics:', None, None)
close1 = stat_cursor[stat.conn.dh_conn_handles][2]
close1 = stat_cursor[stat.conn.dh_conn_handles_closed][2]
sweep1 = stat_cursor[stat.conn.dh_conn_sweeps][2]
stat_cursor.close()

Expand Down Expand Up @@ -127,7 +127,7 @@ def test_disable_idle_timeout_drop_force(self):
# Grab the stats post table drop to see things have decremented
stat_cursor = self.session.open_cursor('statistics:', None, None)
cache2 = stat_cursor[stat.conn.cache_bytes_inuse][2]
close2 = stat_cursor[stat.conn.dh_conn_handles][2]
close2 = stat_cursor[stat.conn.dh_conn_handles_closed][2]
sweep2 = stat_cursor[stat.conn.dh_conn_sweeps][2]
stat_cursor.close()

Expand All @@ -151,7 +151,7 @@ def test_disable_idle_timeout_drop(self):
# We just filled the table, now check what the stats are
stat_cursor = self.session.open_cursor('statistics:', None, None)
cache1 = stat_cursor[stat.conn.cache_bytes_inuse][2]
close1 = stat_cursor[stat.conn.dh_conn_handles][2]
close1 = stat_cursor[stat.conn.dh_conn_handles_closed][2]
sweep1 = stat_cursor[stat.conn.dh_conn_sweeps][2]
stat_cursor.close()

Expand All @@ -162,7 +162,7 @@ def test_disable_idle_timeout_drop(self):
# Grab the stats post table drop to see things have decremented
stat_cursor = self.session.open_cursor('statistics:', None, None)
cache2 = stat_cursor[stat.conn.cache_bytes_inuse][2]
close2 = stat_cursor[stat.conn.dh_conn_handles][2]
close2 = stat_cursor[stat.conn.dh_conn_handles_closed][2]
sweep2 = stat_cursor[stat.conn.dh_conn_sweeps][2]
stat_cursor.close()

Expand Down

0 comments on commit ec69f4e

Please sign in to comment.