Skip to content

Commit c3832a1

Browse files
committed
Rolled back changes to retention policy duration.
1 parent 1af9d4e commit c3832a1

File tree

2 files changed

+8
-49
lines changed

2 files changed

+8
-49
lines changed

influxdb/tests/misc.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
from __future__ import print_function
66
from __future__ import unicode_literals
77

8-
import os
9-
import sys
10-
import subprocess
118
import socket
12-
import distutils
139

1410

1511
def get_free_ports(num_ports, ip='127.0.0.1'):
@@ -48,29 +44,3 @@ def is_port_open(port, ip='127.0.0.1'):
4844
return result == 0
4945
finally:
5046
sock.close()
51-
52-
53-
def find_influxd_path():
54-
influxdb_bin_path = os.environ.get(
55-
'INFLUXDB_PYTHON_INFLUXD_PATH',
56-
None
57-
)
58-
59-
if influxdb_bin_path is None:
60-
influxdb_bin_path = distutils.spawn.find_executable('influxd')
61-
if not influxdb_bin_path:
62-
try:
63-
influxdb_bin_path = subprocess.check_output(
64-
['which', 'influxd']
65-
).strip()
66-
except subprocess.CalledProcessError:
67-
# fallback on :
68-
influxdb_bin_path = '/opt/influxdb/influxd'
69-
70-
if not os.path.isfile(influxdb_bin_path):
71-
raise unittest.SkipTest("Could not find influxd binary")
72-
73-
version = subprocess.check_output([influxdb_bin_path, 'version'])
74-
print("InfluxDB version: %s" % version, file=sys.stderr)
75-
76-
return influxdb_bin_path

influxdb/tests/server_tests/client_test_with_server.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import time
2020
import unittest
2121
import warnings
22-
import subprocess
2322

2423
# By default, raise exceptions on warnings
2524
warnings.simplefilter('error', FutureWarning)
@@ -30,23 +29,13 @@
3029
from influxdb.tests import skipIfPYpy, using_pypy, skipServerTests
3130
from influxdb.tests.server_tests.base import ManyTestCasesWithServerMixin
3231
from influxdb.tests.server_tests.base import SingleTestCaseWithServerMixin
33-
from influxdb.tests.misc import find_influxd_path
3432

3533
if not using_pypy:
3634
import pandas as pd
3735
from pandas.util.testing import assert_frame_equal
3836

3937

4038
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
41-
INFLUXDB_BIN_PATH = find_influxd_path()
42-
INFLUXDB_VERSION = (subprocess.check_output([INFLUXDB_BIN_PATH, 'version'])
43-
.split()[1])
44-
45-
# Version-specific differences between 0.9 and 0.13
46-
if (INFLUXDB_VERSION.split(b'.')[:2] == [b'v0', b'13']):
47-
rp_duration = '0s'
48-
elif (INFLUXDB_VERSION.split(b'.')[:2] == [b'v0', b'9']):
49-
rp_duration = '0'
5039

5140

5241
def point(serie_name, timestamp=None, tags=None, **fields):
@@ -458,7 +447,7 @@ def test_default_retention_policy(self):
458447
self.assertEqual(
459448
[
460449
{'name': 'default',
461-
'duration': rp_duration,
450+
'duration': '0',
462451
'replicaN': 1,
463452
'shardGroupDuration': u'168h0m0s',
464453
'default': True}
@@ -473,7 +462,7 @@ def test_create_retention_policy_default(self):
473462

474463
self.assertEqual(
475464
[
476-
{'duration': rp_duration,
465+
{'duration': '0',
477466
'default': False,
478467
'replicaN': 1,
479468
'shardGroupDuration': u'168h0m0s',
@@ -497,7 +486,7 @@ def test_create_retention_policy(self):
497486
rsp = self.cli.get_list_retention_policies()
498487
self.assertEqual(
499488
[
500-
{'duration': rp_duration,
489+
{'duration': '0',
501490
'default': True,
502491
'replicaN': 1,
503492
'shardGroupDuration': u'168h0m0s',
@@ -520,7 +509,7 @@ def test_alter_retention_policy(self):
520509
rsp = self.cli.get_list_retention_policies()
521510
self.assertEqual(
522511
[
523-
{'duration': rp_duration,
512+
{'duration': '0',
524513
'default': True,
525514
'replicaN': 1,
526515
'shardGroupDuration': u'168h0m0s',
@@ -540,7 +529,7 @@ def test_alter_retention_policy(self):
540529
rsp = self.cli.get_list_retention_policies()
541530
self.assertEqual(
542531
[
543-
{'duration': rp_duration,
532+
{'duration': '0',
544533
'default': True,
545534
'replicaN': 1,
546535
'shardGroupDuration': u'168h0m0s',
@@ -560,7 +549,7 @@ def test_alter_retention_policy(self):
560549
rsp = self.cli.get_list_retention_policies()
561550
self.assertEqual(
562551
[
563-
{'duration': rp_duration,
552+
{'duration': '0',
564553
'default': False,
565554
'replicaN': 1,
566555
'shardGroupDuration': u'168h0m0s',
@@ -584,7 +573,7 @@ def test_alter_retention_policy_invalid(self):
584573
rsp = self.cli.get_list_retention_policies()
585574
self.assertEqual(
586575
[
587-
{'duration': rp_duration,
576+
{'duration': '0',
588577
'default': True,
589578
'replicaN': 1,
590579
'shardGroupDuration': u'168h0m0s',
@@ -606,7 +595,7 @@ def test_drop_retention_policy(self):
606595
rsp = self.cli.get_list_retention_policies()
607596
self.assertEqual(
608597
[
609-
{'duration': rp_duration,
598+
{'duration': '0',
610599
'default': True,
611600
'replicaN': 1,
612601
'shardGroupDuration': u'168h0m0s',

0 commit comments

Comments
 (0)