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

Commit 90585ee

Browse files
committed
infinite test
1 parent c05a76f commit 90585ee

File tree

2 files changed

+62
-49
lines changed

2 files changed

+62
-49
lines changed

contrib/mmts/tests2/lib/event_history.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ def aggregate(self):
6565

6666
agg = {}
6767
for ev in self.events:
68-
if ev['finished_at'] < self.last_aggregation:
69-
#print("cont")
70-
continue
71-
7268
if ev['name'] not in agg:
7369
agg[ev['name']] = copy.deepcopy(self.agg_template)
7470
#print('-=-=-', agg)
@@ -84,6 +80,8 @@ def aggregate(self):
8480
if named_agg['max_latency'] < latency:
8581
named_agg['max_latency'] = latency
8682

83+
self.events = []
84+
8785
for value in self.running_events.itervalues():
8886

8987
if value['name'] not in agg:
@@ -96,8 +94,6 @@ def aggregate(self):
9694
if named_agg['running_latency'] < latency:
9795
named_agg['running_latency'] = latency
9896

99-
self.last_aggregation = datetime.datetime.now()
100-
#print("aggregeted!")
10197
return agg
10298

10399
def aggregate_by(self, period):

contrib/mmts/tests2/test_recovery.py

Lines changed: 60 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,61 +22,78 @@ 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-
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'])
4430

45-
self.clients.set_acc_to_tx(10)
31+
self.clients.set_acc_to_tx(10000)
4632
self.clients.start()
4733

48-
for i in range(5):
34+
for i in range(1000):
4935
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()
5437
print("\n")
5538

5639
self.clients.stop()
5740

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')
6641

67-
# give cluster some time to discover problem
68-
time.sleep(3)
6942

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()
8097

8198
if __name__ == '__main__':
8299
unittest.main()

0 commit comments

Comments
 (0)