@@ -22,34 +22,79 @@ def tearDownClass(self):
2222 self .clients .stop ()
2323 #self.clients[0].cleanup()
2424
25-
26- def test_0_normal_operation (self ):
25+ def test_0_0_0 (self ):
2726 print ('### normalOpsTest ###' )
2827
29- for i in range (1000 ):
30- time .sleep (3 )
31- self .clients .print_agg ()
32-
33- def test_2_node_disconnect (self ):
34- print ('### disconnectTest ###' )
28+ time .sleep (10 )
29+ subprocess .check_call (['blockade' ,'partition' ,'node3' ])
3530
3631 self .clients .set_acc_to_tx (10000 )
3732 self .clients .start ()
3833
39- subprocess .check_call (['blockade' ,'partition' ,'node3' ])
40- print ('Node3 disconnected' )
41-
42- for i in range (5 ):
34+ for i in range (1000 ):
4335 time .sleep (3 )
44- for client in self .clients :
45- agg = client .history .aggregate ()
46- print (agg )
47- self .assertTrue (agg ['transfer' ]['finish' ]['Commit' ] > 0 )
36+ self .clients .print_agg ()
4837 print ("\n " )
4938
50- subprocess .check_call (['blockade' ,'join' ])
5139 self .clients .stop ()
5240
41+
42+
43+ # def test_0_normal_operation(self):
44+ # print('### normalOpsTest ###')
45+ #
46+ # self.clients.set_acc_to_tx(10000)
47+ # self.clients.start()
48+ #
49+ # for i in range(5):
50+ # time.sleep(3)
51+ # for client in self.clients:
52+ # agg = client.history.aggregate()
53+ # print(agg)
54+ # self.assertTrue(agg['transfer']['finish']['Commit'] > 0)
55+ # print("\n")
56+ #
57+ # self.clients.stop()
58+ #
59+ # def test_1_distributed_deadlock(self):
60+ # print('### DDD test ###')
61+ #
62+ # self.clients.set_acc_to_tx(10)
63+ # self.clients.start()
64+ #
65+ # for i in range(5):
66+ # time.sleep(3)
67+ # for client in self.clients:
68+ # agg = client.history.aggregate()
69+ # print(agg)
70+ # self.assertTrue(agg['transfer']['finish']['Commit'] > 0)
71+ # print("\n")
72+ #
73+ # self.clients.stop()
74+ #
75+ # def test_2_node_disconnect(self):
76+ # print('### disconnectTest ###')
77+ #
78+ # self.clients.set_acc_to_tx(10000)
79+ # self.clients.start()
80+ #
81+ # subprocess.check_call(['blockade','partition','node3'])
82+ # print('Node3 disconnected')
83+ #
84+ # # give cluster some time to discover problem
85+ # time.sleep(3)
86+ #
87+ # for i in range(5):
88+ # time.sleep(3)
89+ # for client in self.clients:
90+ # agg = client.history.aggregate()
91+ # print(agg)
92+ # self.assertTrue(agg['transfer']['finish']['Commit'] > 0)
93+ # print("\n")
94+ #
95+ # subprocess.check_call(['blockade','join'])
96+ # self.clients.stop()
97+
5398 subprocess .check_call (['blockade' ,'join' ])
5499 print ("Node3 joined back" )
55100
0 commit comments