-
Notifications
You must be signed in to change notification settings - Fork 95
/
corrupt_then_rebuild_test.py
38 lines (30 loc) · 1.29 KB
/
corrupt_then_rebuild_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright (c) 2017 ScyllaDB
from sdcm.tester import ClusterTester
from sdcm import nemesis
class CorruptThenRebuildTest(ClusterTester):
"""
Corrupt the data file and rebuild
"""
def test_corrupt_then_rebuild_nodes(self):
# populates 100GB
write_queue = self.populate_data_parallel(100, blocking=False)
self.db_cluster.wait_total_space_used_per_node(50 * (1024 ** 3)) # calculates 50gb in bytes
# run rebuild
current_nemesis = nemesis.CorruptThenRebuildMonkey(
tester_obj=self, termination_event=self.db_cluster.nemesis_termination_event)
current_nemesis.disrupt()
for stress in write_queue:
self.verify_stress_thread(cs_thread_pool=stress)
self.populate_data_parallel(100, blocking=False, read=True)