@@ -22,61 +22,78 @@ def tearDownClass(self):
22
22
self .clients .stop ()
23
23
#self.clients[0].cleanup()
24
24
25
-
26
- def test_0_normal_operation (self ):
25
+ def test_0_0_0 (self ):
27
26
print ('### normalOpsTest ###' )
28
27
29
- self .clients .set_acc_to_tx (10000 )
30
- self .clients .start ()
31
-
32
- for i in range (5 ):
33
- time .sleep (3 )
34
- for client in self .clients :
35
- agg = client .history .aggregate ()
36
- print (agg )
37
- self .assertTrue (agg ['transfer' ]['finish' ]['Commit' ] > 0 )
38
- print ("\n " )
39
-
40
- self .clients .stop ()
41
-
42
- def test_1_distributed_deadlock (self ):
43
- print ('### DDD test ###' )
28
+ time .sleep (10 )
29
+ subprocess .check_call (['blockade' ,'partition' ,'node3' ])
44
30
45
- self .clients .set_acc_to_tx (10 )
31
+ self .clients .set_acc_to_tx (10000 )
46
32
self .clients .start ()
47
33
48
- for i in range (5 ):
34
+ for i in range (1000 ):
49
35
time .sleep (3 )
50
- for client in self .clients :
51
- agg = client .history .aggregate ()
52
- print (agg )
53
- self .assertTrue (agg ['transfer' ]['finish' ]['Commit' ] > 0 )
36
+ self .clients .print_agg ()
54
37
print ("\n " )
55
38
56
39
self .clients .stop ()
57
40
58
- def test_2_node_disconnect (self ):
59
- print ('### disconnectTest ###' )
60
-
61
- self .clients .set_acc_to_tx (10000 )
62
- self .clients .start ()
63
-
64
- subprocess .check_call (['blockade' ,'partition' ,'node3' ])
65
- print ('Node3 disconnected' )
66
41
67
- # give cluster some time to discover problem
68
- time .sleep (3 )
69
42
70
- for i in range (5 ):
71
- time .sleep (3 )
72
- for client in self .clients :
73
- agg = client .history .aggregate ()
74
- print (agg )
75
- self .assertTrue (agg ['transfer' ]['finish' ]['Commit' ] > 0 )
76
- print ("\n " )
77
-
78
- subprocess .check_call (['blockade' ,'join' ])
79
- self .clients .stop ()
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()
80
97
81
98
if __name__ == '__main__' :
82
99
unittest .main ()
0 commit comments