Skip to content

Commit

Permalink
Increase rpc test timouts to avoid local test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Sep 30, 2020
1 parent dbca540 commit d6ef782
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
- Added ability to snapshot hard-deleted records (opt-in with `invalidate_hard_deletes` config option). ([#249](https://github.com/fishtown-analytics/dbt/issues/249), [#2749](https://github.com/fishtown-analytics/dbt/pull/2749))
- Improved error messages for YAML selectors ([#2700](https://github.com/fishtown-analytics/dbt/issues/2700), [#2781](https://github.com/fishtown-analytics/dbt/pull/2781))

### Under the hood
- Changed rpc test timeouts to avoid locally run test failures ([#2803](https://github.com/fishtown-analytics/dbt/issues/2803))

Contributors:
- [@joelluijmes](https://github.com/joelluijmes) ([#2749](https://github.com/fishtown-analytics/dbt/pull/2749))

Expand Down
16 changes: 8 additions & 8 deletions test/integration/100_rpc_test/test_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def is_up(self):

def start(self):
super().start()
for _ in range(60):
for _ in range(180):
if self.is_up():
break
time.sleep(0.5)
Expand Down Expand Up @@ -113,7 +113,7 @@ def setUp(self):
os.environ['DBT_TEST_SCHEMA_NAME_VARIABLE'] = 'test_run_schema'
if self.should_seed:
self.run_dbt_with_vars(['seed'], strict=False)
port = random.randint(20000, 65535)
port = random.randint(49152, 61000)
self._server = self.ServerProcess(
cli_vars='{{test_run_schema: {}}}'.format(self.unique_schema()),
profiles_dir=self.test_root_dir,
Expand Down Expand Up @@ -178,7 +178,7 @@ def build_query(
def url(self):
return 'http://localhost:{}/jsonrpc'.format(self._server.port)

def poll_for_result(self, request_token, request_id=1, timeout=60, state='success', logs=None):
def poll_for_result(self, request_token, request_id=1, timeout=180, state='success', logs=None):
start = time.time()
kwargs = {
'request_token': request_token,
Expand All @@ -204,7 +204,7 @@ def poll_for_result(self, request_token, request_id=1, timeout=60, state='succes
.format(delta, state, result)
)

def async_query(self, _method, _sql=None, _test_request_id=1, _poll_timeout=60, macros=None, **kwargs):
def async_query(self, _method, _sql=None, _test_request_id=1, _poll_timeout=180, macros=None, **kwargs):
response = self.query(_method, _sql, _test_request_id, macros, **kwargs).json()
result = self.assertIsResult(response, _test_request_id)
self.assertIn('request_token', result)
Expand Down Expand Up @@ -346,7 +346,7 @@ def get_sleep_query(self, duration=15, request_id=90890):
return request_token, request_id

def wait_for_state(
self, state, timestamp, timeout=25, raise_on_timeout=True
self, state, timestamp, timeout=180, raise_on_timeout=True
):
started = time.time()
time.sleep(0.5)
Expand Down Expand Up @@ -994,7 +994,7 @@ def test_sighup_postgres(self):
self.assertIsResult(done_query)
sleepers = []

sleepers.append(self.get_sleep_query(duration=60, request_id=1000))
sleepers.append(self.get_sleep_query(duration=180, request_id=1000))
self.assertRunning(sleepers)

self.run_command_with_id('seed', 20)
Expand Down Expand Up @@ -1135,7 +1135,7 @@ def test_deps_compilation_postgres(self):
status = self._check_start_predeps()

# do a dbt deps, wait for the result
self.assertIsResult(self.async_query('deps', _poll_timeout=120).json())
self.assertIsResult(self.async_query('deps', _poll_timeout=180).json())

self._check_deps_ok(status)

Expand All @@ -1145,6 +1145,6 @@ def test_deps_cli_compilation_postgres(self):
status = self._check_start_predeps()

# do a dbt deps, wait for the result
self.assertIsResult(self.async_query('cli_args', cli='deps', _poll_timeout=120).json())
self.assertIsResult(self.async_query('cli_args', cli='deps', _poll_timeout=180).json())

self._check_deps_ok(status)

0 comments on commit d6ef782

Please sign in to comment.