Skip to content

Commit f95bd82

Browse files
author
aviau
committed
Run UDP tests on random ports
1 parent b77209f commit f95bd82

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/influxdb/client_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import socket
99
import unittest
1010
import requests_mock
11+
import random
1112
from nose.tools import raises
1213
from mock import patch
1314
import warnings
@@ -160,11 +161,12 @@ def test_write_points_batch(self):
160161

161162
def test_write_points_udp(self):
162163
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
163-
s.bind(('0.0.0.0', 4444))
164+
port = random.randint(4000, 8000)
165+
s.bind(('0.0.0.0', port))
164166

165167
cli = InfluxDBClient(
166168
'localhost', 8086, 'root', 'root',
167-
'test', use_udp=True, udp_port=4444
169+
'test', use_udp=True, udp_port=port
168170
)
169171
cli.write_points(self.dummy_points)
170172

tests/influxdb/influxdb08/client_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import socket
99
import unittest
1010
import requests_mock
11+
import random
1112
from nose.tools import raises
1213
from mock import patch
1314
import warnings
@@ -176,11 +177,12 @@ def test_write_points_batch(self):
176177

177178
def test_write_points_udp(self):
178179
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
179-
s.bind(('0.0.0.0', 4444))
180+
port = random.randint(4000, 8000)
181+
s.bind(('0.0.0.0', port))
180182

181183
cli = InfluxDBClient(
182184
'localhost', 8086, 'root', 'root',
183-
'test', use_udp=True, udp_port=4444
185+
'test', use_udp=True, udp_port=port
184186
)
185187
cli.write_points(self.dummy_points)
186188

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy