File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
modules/trino/testcontainers/trino Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 1111# License for the specific language governing permissions and limitations
1212# under the License.
1313import re
14+ import time
1415
1516from testcontainers .core .config import testcontainers_config as c
1617from testcontainers .core .generic import DbContainer
@@ -24,12 +25,14 @@ def __init__(
2425 image = "trinodb/trino:latest" ,
2526 user : str = "test" ,
2627 port : int = 8080 ,
28+ delay : int = 5 ,
2729 ** kwargs ,
2830 ):
2931 super ().__init__ (image = image , ** kwargs )
3032 self .user = user
3133 self .port = port
3234 self .with_exposed_ports (self .port )
35+ self .delay = delay
3336
3437 @wait_container_is_ready ()
3538 def _connect (self ) -> None :
@@ -39,6 +42,8 @@ def _connect(self) -> None:
3942 c .max_tries ,
4043 c .sleep_time ,
4144 )
45+ # To avoid `TrinoQueryError(type=INTERNAL_ERROR, name=GENERIC_INTERNAL_ERROR, message="nodes is empty")`
46+ time .sleep (self .delay )
4247 conn = connect (
4348 host = self .get_container_host_ip (),
4449 port = self .get_exposed_port (self .port ),
You can’t perform that action at this time.
0 commit comments