Skip to content

Commit ec8166b

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "tests: Attempt to use configured tmp in xprofile tests"
2 parents 6a0153f + becb3ff commit ec8166b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/unit/common/middleware/test_xprofile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ class TestProfileMiddleware(unittest.TestCase):
8383
@unittest.skipIf(xprofile is None, "can't import xprofile")
8484
def setUp(self):
8585
self.got_statuses = []
86-
self.app = ProfileMiddleware(FakeApp, {})
87-
self.tempdir = os.path.dirname(self.app.log_filename_prefix)
86+
self.tempdir = tempfile.mkdtemp()
87+
log_filename_prefix = os.path.join(
88+
self.tempdir,
89+
'log/swift/profile/default.profile')
90+
conf = {'log_filename_prefix': log_filename_prefix}
91+
self.app = ProfileMiddleware(FakeApp, conf)
8892
self.pids = ['123', '456', str(os.getpid())]
8993
profiler = xprofile.get_profiler('eventlet.green.profile')
9094
for pid in self.pids:

0 commit comments

Comments
 (0)