[
https://issues.apache.org/jira/browse/BEAM-10591?focusedWorklogId=464338&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-464338
]
ASF GitHub Bot logged work on BEAM-10591:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Jul/20 07:30
Start Date: 30/Jul/20 07:30
Worklog Time Spent: 10m
Work Description: piotr-szuberski commented on a change in pull request
#12406:
URL: https://github.com/apache/beam/pull/12406#discussion_r462771399
##########
File path: sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py
##########
@@ -91,7 +90,12 @@ def setUp(self):
self.host, self.port, self.database_name)
def tearDown(self):
- self.postgres.stop()
+ # Sometimes stopping the container raises ReadTimeout. We can ignore it
+ # here to avoid the test failure.
+ try:
+ self.postgres.stop()
+ except: # pylint: disable=bare-except
Review comment:
Yes, I think so. Done.
##########
File path: sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py
##########
@@ -150,6 +154,18 @@ def test_xlang_jdbc_read(self):
assert_that(
result, equal_to([JdbcReadTestRow(i) for i in range(ROW_COUNT)]))
+ # Creating a container with testcontainers sometimes raises ReadTimeout
+ # error. In java there are 2 retries set by default.
+ def start_postgres_container(self, retries):
+ for i in range(retries):
+ try:
+ self.postgres = PostgresContainer('postgres:12.3')
+ self.postgres.start()
+ break
+ except: # pylint: disable=bare-except
+ if i == retries - 1:
+ raise RuntimeError('Unable to initialize postgres container.')
Review comment:
I added the log and reraised the exception cause.
##########
File path: sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py
##########
@@ -150,6 +154,18 @@ def test_xlang_jdbc_read(self):
assert_that(
result, equal_to([JdbcReadTestRow(i) for i in range(ROW_COUNT)]))
+ # Creating a container with testcontainers sometimes raises ReadTimeout
+ # error. In java there are 2 retries set by default.
+ def start_postgres_container(self, retries):
+ for i in range(retries):
+ try:
+ self.postgres = PostgresContainer('postgres:12.3')
+ self.postgres.start()
+ break
+ except: # pylint: disable=bare-except
+ if i == retries - 1:
+ raise RuntimeError('Unable to initialize postgres container.')
Review comment:
I added the log and reraised the primary exception.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 464338)
Time Spent: 0.5h (was: 20m)
> apache_beam.io.external.xlang_jdbcio_it_test.CrossLanguageJdbcIOTest is flaky
> -----------------------------------------------------------------------------
>
> Key: BEAM-10591
> URL: https://issues.apache.org/jira/browse/BEAM-10591
> Project: Beam
> Issue Type: Bug
> Components: io-java-jdbc, sdk-py-core
> Reporter: Tyson Hamilton
> Assignee: Piotr Szuberski
> Priority: P1
> Labels: flake, flaky-test
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> There have been recent failures for both test_xlang_jdbc_read and
> test_xlang_jdbc_write. Some examples can be found at:
> [https://ci-beam.apache.org/job/beam_PostCommit_Python37/2643/testReport/junit/apache_beam.io.external.xlang_jdbcio_it_test/CrossLanguageJdbcIOTest/test_xlang_jdbc_read/]
> [https://ci-beam.apache.org/job/beam_PostCommit_Python37/2643/testReport/junit/apache_beam.io.external.xlang_jdbcio_it_test/CrossLanguageJdbcIOTest/test_xlang_jdbc_write/]
> [https://ci-beam.apache.org/job/beam_PostCommit_Python37/2641/testReport/junit/apache_beam.io.external.xlang_jdbcio_it_test/CrossLanguageJdbcIOTest/test_xlang_jdbc_read/]
> All failures are read timeout related:
> {code:java}
> Stacktrace File "/usr/lib/python3.7/unittest/case.py", line 59, in
> testPartExecutor
> yield
> File "/usr/lib/python3.7/unittest/case.py", line 618, in run
> self.tearDown()
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py",
> line 94, in tearDown
> self.postgres.stop()
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/testcontainers/core/container.py",
> line 61, in stop
> self.get_wrapped_container().remove(force=force, v=delete_volume)
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/docker/models/containers.py",
> line 347, in remove
> return self.client.api.remove_container(self.id, **kwargs)
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/docker/utils/decorators.py",
> line 19, in wrapped
> return f(self, resource_id, *args, **kwargs)
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/docker/api/container.py",
> line 994, in remove_container
> self._url("/containers/{0}", container), params=params
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/docker/utils/decorators.py",
> line 46, in inner
> return f(self, *args, **kwargs)
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/docker/api/client.py",
> line 238, in _delete
> return self.delete(url, **self._set_request_timeout(kwargs))
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/requests/sessions.py",
> line 612, in delete
> return self.request('DELETE', url, **kwargs)
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/requests/sessions.py",
> line 530, in request
> resp = self.send(prep, **send_kwargs)
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/requests/sessions.py",
> line 643, in send
> r = adapter.send(request, **kwargs)
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python37/src/build/gradleenv/2022703441/lib/python3.7/site-packages/requests/adapters.py",
> line 529, in send
> raise ReadTimeout(e, request=request)
> UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read
> timeout=60)
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)