Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
a839140ff4
1 changed files with 11 additions and 19 deletions
|
|
@ -588,6 +588,10 @@ class State():
|
||||||
if not skip_disk:
|
if not skip_disk:
|
||||||
self.disks.append(disk_obj)
|
self.disks.append(disk_obj)
|
||||||
|
|
||||||
|
# Start tmux thread
|
||||||
|
self.tmux_layout = TMUX_LAYOUT.copy()
|
||||||
|
start_thread(fix_tmux_panes_loop, args=[self])
|
||||||
|
|
||||||
|
|
||||||
class TestObj():
|
class TestObj():
|
||||||
"""Object to track test data."""
|
"""Object to track test data."""
|
||||||
|
|
@ -664,9 +668,6 @@ def fix_tmux_panes_loop(state):
|
||||||
try:
|
try:
|
||||||
fix_tmux_panes(state)
|
fix_tmux_panes(state)
|
||||||
sleep(1)
|
sleep(1)
|
||||||
except AttributeError:
|
|
||||||
# tmux_layout attribute has been deleted, exit function
|
|
||||||
return
|
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
# Assuming layout definitions changes mid-run, ignoring
|
# Assuming layout definitions changes mid-run, ignoring
|
||||||
pass
|
pass
|
||||||
|
|
@ -676,6 +677,10 @@ def fix_tmux_panes(state):
|
||||||
"""Fix pane sizes if the window has been resized."""
|
"""Fix pane sizes if the window has been resized."""
|
||||||
needs_fixed = False
|
needs_fixed = False
|
||||||
|
|
||||||
|
# Bail?
|
||||||
|
if not state.panes:
|
||||||
|
return
|
||||||
|
|
||||||
# Check layout
|
# Check layout
|
||||||
for k, v in state.tmux_layout.items():
|
for k, v in state.tmux_layout.items():
|
||||||
if not v.get('Check'):
|
if not v.get('Check'):
|
||||||
|
|
@ -1013,7 +1018,6 @@ def run_hw_tests(state):
|
||||||
# Build Panes
|
# Build Panes
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
build_outer_panes(state)
|
build_outer_panes(state)
|
||||||
start_tmux_repair_thread(state)
|
|
||||||
|
|
||||||
# Show selected tests and create TestObj()s
|
# Show selected tests and create TestObj()s
|
||||||
print_info('Selected Tests:')
|
print_info('Selected Tests:')
|
||||||
|
|
@ -1075,13 +1079,13 @@ def run_hw_tests(state):
|
||||||
state.ost.post_device_results(state.cpu, state.ticket_id)
|
state.ost.post_device_results(state.cpu, state.ticket_id)
|
||||||
except GenericAbort:
|
except GenericAbort:
|
||||||
# Cleanup
|
# Cleanup
|
||||||
stop_tmux_repair_thread(state)
|
|
||||||
tmux_kill_pane(*state.panes.values())
|
tmux_kill_pane(*state.panes.values())
|
||||||
|
state.panes.clear()
|
||||||
|
state.tmux_layout.pop('Current', None)
|
||||||
|
|
||||||
# Rebuild panes
|
# Rebuild panes
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
build_outer_panes(state)
|
build_outer_panes(state)
|
||||||
start_tmux_repair_thread(state)
|
|
||||||
|
|
||||||
# Mark unfinished tests as aborted
|
# Mark unfinished tests as aborted
|
||||||
for k, v in state.tests.items():
|
for k, v in state.tests.items():
|
||||||
|
|
@ -1138,6 +1142,7 @@ def run_hw_tests(state):
|
||||||
state.ost.disconnect(full=True)
|
state.ost.disconnect(full=True)
|
||||||
stop_tmux_repair_thread(state)
|
stop_tmux_repair_thread(state)
|
||||||
tmux_kill_pane(*state.panes.values())
|
tmux_kill_pane(*state.panes.values())
|
||||||
|
state.panes.clear()
|
||||||
|
|
||||||
|
|
||||||
def run_io_benchmark(state, test):
|
def run_io_benchmark(state, test):
|
||||||
|
|
@ -1681,19 +1686,6 @@ def show_results(state):
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
|
|
||||||
|
|
||||||
def start_tmux_repair_thread(state):
|
|
||||||
"""Fix tmux panes as long as state.tmux_layout attribute exists."""
|
|
||||||
state.tmux_layout = TMUX_LAYOUT.copy()
|
|
||||||
start_thread(fix_tmux_panes_loop, args=[state])
|
|
||||||
|
|
||||||
|
|
||||||
def stop_tmux_repair_thread(state):
|
|
||||||
"""Stop previous thread by causing an AttributeError in the thread."""
|
|
||||||
if hasattr(state, 'tmux_layout'):
|
|
||||||
del state.tmux_layout
|
|
||||||
sleep(1)
|
|
||||||
|
|
||||||
|
|
||||||
def update_main_options(state, selection, main_options):
|
def update_main_options(state, selection, main_options):
|
||||||
"""Update menu and state based on selection."""
|
"""Update menu and state based on selection."""
|
||||||
index = int(selection) - 1
|
index = int(selection) - 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue