From: Ramana Raja Date: Thu, 30 Jun 2016 08:26:35 +0000 (+0530) Subject: tasks/cephfs: rename 'long_running' decorator X-Git-Tag: v11.1.1~58^2^2~152^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6d074bdb4c0580678517874629eb61d03935cbb8;p=ceph.git tasks/cephfs: rename 'long_running' decorator Rename 'long_running' decorator as 'for_teuthology', which is more intuitive. Signed-off-by: Ramana Raja --- diff --git a/tasks/cephfs/cephfs_test_case.py b/tasks/cephfs/cephfs_test_case.py index 73499da7ba9..fb24fd6e226 100644 --- a/tasks/cephfs/cephfs_test_case.py +++ b/tasks/cephfs/cephfs_test_case.py @@ -16,11 +16,11 @@ from teuthology.orchestra.run import CommandFailedError log = logging.getLogger(__name__) -def long_running(f): +def for_teuthology(f): """ - Decorator that adds an "is_long_running" attribute to the wrapped function + Decorator that adds an "is_for_teuthology" attribute to the wrapped function """ - f.is_long_running = True + f.is_for_teuthology = True return f diff --git a/tasks/cephfs/test_cap_flush.py b/tasks/cephfs/test_cap_flush.py index 1e5abb73212..1cd102f3aa6 100644 --- a/tasks/cephfs/test_cap_flush.py +++ b/tasks/cephfs/test_cap_flush.py @@ -4,10 +4,10 @@ import time from textwrap import dedent from unittest import SkipTest from tasks.cephfs.fuse_mount import FuseMount -from tasks.cephfs.cephfs_test_case import CephFSTestCase, long_running +from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology class TestCapFlush(CephFSTestCase): - @long_running + @for_teuthology def test_replay_create(self): """ MDS starts to handle client caps when it enters clientreplay stage. diff --git a/tasks/cephfs/test_damage.py b/tasks/cephfs/test_damage.py index 88a67e27e80..9c8d8ecbd5f 100644 --- a/tasks/cephfs/test_damage.py +++ b/tasks/cephfs/test_damage.py @@ -5,7 +5,7 @@ import re from teuthology.contextutil import MaxWhileTries from teuthology.exceptions import CommandFailedError from teuthology.orchestra.run import wait -from tasks.cephfs.cephfs_test_case import CephFSTestCase, long_running +from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology DAMAGED_ON_START = "damaged_on_start" DAMAGED_ON_LS = "damaged_on_ls" @@ -34,7 +34,7 @@ class TestDamage(CephFSTestCase): mds_map = self.fs.get_mds_map() return rank in mds_map['damaged'] - @long_running #459s + @for_teuthology #459s def test_object_deletion(self): """ That the MDS has a clean 'damaged' response to loss of any single metadata object diff --git a/tasks/cephfs/test_data_scan.py b/tasks/cephfs/test_data_scan.py index 31bca165655..134b567b916 100644 --- a/tasks/cephfs/test_data_scan.py +++ b/tasks/cephfs/test_data_scan.py @@ -10,7 +10,7 @@ import traceback from collections import namedtuple from teuthology.orchestra.run import CommandFailedError -from tasks.cephfs.cephfs_test_case import CephFSTestCase, long_running +from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology log = logging.getLogger(__name__) @@ -506,6 +506,6 @@ class TestDataScan(CephFSTestCase): keys = self._dirfrag_keys(frag_obj_id) self.assertListEqual(sorted(keys), sorted(["%s_head" % f for f in file_names])) - @long_running + @for_teuthology def test_parallel_execution(self): self._rebuild_metadata(ManyFilesWorkload(self.fs, self.mount_a, 25), workers=7) diff --git a/tasks/cephfs/test_journal_repair.py b/tasks/cephfs/test_journal_repair.py index 9ee49247202..163d83acf06 100644 --- a/tasks/cephfs/test_journal_repair.py +++ b/tasks/cephfs/test_journal_repair.py @@ -10,7 +10,7 @@ import time from teuthology.orchestra.run import CommandFailedError from tasks.cephfs.filesystem import ObjectNotFound, ROOT_INO -from tasks.cephfs.cephfs_test_case import CephFSTestCase, long_running +from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology from tasks.workunit import task as workunit log = logging.getLogger(__name__) @@ -147,7 +147,7 @@ class TestJournalRepair(CephFSTestCase): # Check that we can do metadata ops in the recovered directory self.mount_a.run_shell(["touch", "subdir/subsubdir/subsubdirfile"]) - @long_running # 308s + @for_teuthology # 308s def test_reset(self): """ That after forcibly modifying the backing store, we can get back into @@ -396,7 +396,7 @@ class TestJournalRepair(CephFSTestCase): "result": 0}} ) - @long_running # Hack: "long running" because .sh doesn't work outside teuth + @for_teuthology # Hack: "for_teuthology" because .sh doesn't work outside teuth def test_journal_smoke(self): workunit(self.ctx, { 'clients': { diff --git a/tasks/cephfs/test_strays.py b/tasks/cephfs/test_strays.py index 591d403de92..ce55fc320f1 100644 --- a/tasks/cephfs/test_strays.py +++ b/tasks/cephfs/test_strays.py @@ -4,7 +4,7 @@ import logging from textwrap import dedent import gevent from teuthology.orchestra.run import CommandFailedError -from tasks.cephfs.cephfs_test_case import CephFSTestCase, long_running +from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology log = logging.getLogger(__name__) @@ -18,11 +18,11 @@ class TestStrays(CephFSTestCase): # Range of different file sizes used in throttle test's workload throttle_workload_size_range = 16 - @long_running + @for_teuthology def test_ops_throttle(self): self._test_throttling(self.OPS_THROTTLE) - @long_running + @for_teuthology def test_files_throttle(self): self._test_throttling(self.FILES_THROTTLE) diff --git a/tasks/cephfs/vstart_runner.py b/tasks/cephfs/vstart_runner.py index 62c7e5486c0..5a0581fd8e5 100644 --- a/tasks/cephfs/vstart_runner.py +++ b/tasks/cephfs/vstart_runner.py @@ -844,7 +844,7 @@ def exec_test(): drop_test = False - if hasattr(fn, 'is_long_running') and getattr(fn, 'is_long_running') is True: + if hasattr(fn, 'is_for_teuthology') and getattr(fn, 'is_for_teuthology') is True: drop_test = True log.warn("Dropping test because long running: ".format(method.id())) @@ -863,7 +863,7 @@ def exec_test(): if not is_named: victims.append((case, method)) - log.info("Disabling {0} tests because of is_long_running or needs_trimming".format(len(victims))) + log.info("Disabling {0} tests because of is_for_teuthology or needs_trimming".format(len(victims))) for s, method in victims: s._tests.remove(method)