Taragolis commented on code in PR #27696:
URL: https://github.com/apache/airflow/pull/27696#discussion_r1024833332


##########
tests/providers/common/sql/sensors/test_sql.py:
##########
@@ -245,8 +242,8 @@ def test_sql_sensor_postgres_poke_invalid_success(self, 
mock_hook):
             op.poke(None)
         assert "self.success is present, but not callable -> [1]" == 
str(ctx.value)
 
-    @unittest.skipIf(
-        "AIRFLOW_RUNALL_TESTS" not in os.environ, "Skipped because 
AIRFLOW_RUNALL_TESTS is not set"
+    @pytest.mark.skipif(
+        "AIRFLOW_RUNALL_TESTS" not in os.environ, reason="Skipped because 
AIRFLOW_RUNALL_TESTS is not set"

Review Comment:
   I have no idea is variable `AIRFLOW_RUNALL_TESTS` set anywhere because I 
couldn't find any reference outside of tests in `main`. This variable also 
check in some other tests
   
   I found that initially this env added by this PR 
https://github.com/apache/airflow/pull/7468 and info about it should store into 
the https://issues.apache.org/jira/browse/AIRFLOW-6847 (unfortunately I do not 
have access).
   
   When I tried set `export AIRFLOW_RUNALL_TESTS=x` in `breeze` and run tests 
I've always get same error, regardless of whether migrated to pytest or not
   
   ```
   ERROR    airflow.task:taskinstance.py:1749 Task failed with exception
   Traceback (most recent call last):
     File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 
175, in _new_conn
       (self._dns_host, self.port), self.timeout, **extra_kw
     File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", 
line 95, in create_connection
       raise err
     File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", 
line 85, in create_connection
       sock.connect(sa)
   ConnectionRefusedError: [Errno 111] Connection refused
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", 
line 710, in urlopen
       chunked=chunked,
     File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", 
line 398, in _make_request
       conn.request(method, url, **httplib_request_kw)
     File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 
239, in request
       super(HTTPConnection, self).request(method, url, body=body, 
headers=headers)
     File "/usr/local/lib/python3.7/http/client.py", line 1281, in request
       self._send_request(method, url, body, headers, encode_chunked)
     File "/usr/local/lib/python3.7/http/client.py", line 1327, in _send_request
       self.endheaders(body, encode_chunked=encode_chunked)
     File "/usr/local/lib/python3.7/http/client.py", line 1276, in endheaders
       self._send_output(message_body, encode_chunked=encode_chunked)
     File "/usr/local/lib/python3.7/http/client.py", line 1036, in _send_output
       self.send(msg)
     File "/usr/local/lib/python3.7/http/client.py", line 976, in send
       self.connect()
     File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 
205, in connect
       conn = self._new_conn()
     File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 
187, in _new_conn
       self, "Failed to establish a new connection: %s" % e
   urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection 
object at 0x7f4a91d33e10>: Failed to establish a new connection: [Errno 111] 
Connection refused
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 
499, in send
       timeout=timeout,
     File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", 
line 788, in urlopen
       method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
     File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 
592, in increment
       raise MaxRetryError(_pool, url, error or ResponseError(cause))
   urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', 
port=3400): Max retries exceeded with url: /v1/statement (Caused by 
NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7f4a91d33e10>: Failed to establish a new connection: [Errno 111] Connection 
refused'))
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/opt/airflow/airflow/sensors/base.py", line 200, in execute
       poke_return = self.poke(context)
     File "/opt/airflow/airflow/providers/common/sql/sensors/sql.py", line 92, 
in poke
       records = hook.get_records(self.sql, self.parameters)
     File "/opt/airflow/airflow/providers/presto/hooks/presto.py", line 152, in 
get_records
       return super().get_records(self.strip_sql_string(sql), parameters)
     File "/opt/airflow/airflow/providers/common/sql/hooks/sql.py", line 196, 
in get_records
       return self.run(sql=sql, parameters=parameters, 
handler=fetch_all_handler)
     File "/opt/airflow/airflow/providers/presto/hooks/presto.py", line 196, in 
run
       return_last=return_last,
     File "/opt/airflow/airflow/providers/common/sql/hooks/sql.py", line 266, 
in run
       self._run_command(cur, sql_statement, parameters)
     File "/opt/airflow/airflow/providers/common/sql/hooks/sql.py", line 291, 
in _run_command
       cur.execute(sql_statement)
     File "/usr/local/lib/python3.7/site-packages/prestodb/dbapi.py", line 236, 
in execute
       result = self._query.execute()
     File "/usr/local/lib/python3.7/site-packages/prestodb/client.py", line 
542, in execute
       response = self._request.post(self._sql)
     File "/usr/local/lib/python3.7/site-packages/prestodb/client.py", line 
356, in post
       proxies=PROXIES,
     File "/usr/local/lib/python3.7/site-packages/prestodb/exceptions.py", line 
130, in decorated
       raise error
     File "/usr/local/lib/python3.7/site-packages/prestodb/exceptions.py", line 
117, in decorated
       result = func(*args, **kwargs)
     File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 
635, in post
       return self.request("POST", url, data=data, json=json, **kwargs)
     File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 
587, in request
       resp = self.send(prep, **send_kwargs)
     File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 
701, in send
       r = adapter.send(request, **kwargs)
     File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 
565, in send
       raise ConnectionError(e, request=request)
   requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', 
port=3400): Max retries exceeded with url: /v1/statement (Caused by 
NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7f4a91d33e10>: Failed to establish a new connection: [Errno 111] Connection 
refused'))
   ```
   
   Is it possible that this kind of tests are actually broken and just not run 
in CI?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to