Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cdec612

Browse files
committed
fix insert test: it is only valid to check rows count only when all load is stopped
1 parent 0d842a2 commit cdec612

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

tests2/test_referee.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def tearDownClass(cls):
4545
if cls.client.no_prepared_tx() != 0:
4646
raise AssertionError('There are some uncommitted tx')
4747

48+
counts = cls.client.insert_counts()
49+
if counts[0] != counts[1]:
50+
raise AssertionError('Different number of tuples on nodes: %d / %d' % (counts[0], counts[1]) )
51+
4852
# XXX: check nodes data identity here
4953
# subprocess.check_call(['docker-compose','down'])
5054

@@ -68,9 +72,6 @@ def test_neighbor_restart(self):
6872
self.assertCommits(aggs)
6973
self.assertIsolation(aggs)
7074

71-
counts = self.client.insert_counts()
72-
self.assertEqual(counts[0], counts[1])
73-
7475

7576
def test_node_crash(self):
7677
print('### test_node_crash ###')
@@ -84,9 +85,6 @@ def test_node_crash(self):
8485
self.assertCommits(aggs)
8586
self.assertIsolation(aggs)
8687

87-
counts = self.client.insert_counts()
88-
self.assertEqual(counts[0], counts[1])
89-
9088

9189
def test_partition_referee(self):
9290
print('### test_partition_referee ###')
@@ -100,8 +98,6 @@ def test_partition_referee(self):
10098
self.assertCommits(aggs)
10199
self.assertIsolation(aggs)
102100

103-
counts = self.client.insert_counts()
104-
self.assertEqual(counts[0], counts[1])
105101

106102
def test_double_failure_referee(self):
107103
print('### test_double_failure_referee ###')
@@ -124,8 +120,6 @@ def test_double_failure_referee(self):
124120
self.assertCommits(aggs)
125121
self.assertIsolation(aggs)
126122

127-
counts = self.client.insert_counts()
128-
self.assertEqual(counts[0], counts[1])
129123

130124
def test_saved_referee_decision(self):
131125
print('### test_saved_referee_decision ###')
@@ -198,8 +192,6 @@ def test_saved_referee_decision(self):
198192

199193
self.assertEqual(decisions_count, 0)
200194

201-
counts = self.client.insert_counts()
202-
self.assertEqual(counts[0], counts[1])
203195

204196
def test_winner_restart(self):
205197
print('### test_winner_restart ###')
@@ -228,9 +220,6 @@ def test_winner_restart(self):
228220
docker_api.containers.get('node1').start()
229221
self.awaitCommit(0)
230222

231-
counts = self.client.insert_counts()
232-
self.assertEqual(counts[0], counts[1])
233-
234223

235224
if __name__ == '__main__':
236225
unittest.main()

0 commit comments

Comments
 (0)