@Override
    public void waitUntilReady(WaitStrategyTarget target) {
        YugabyteDBYCQLContainer container = (YugabyteDBYCQLContainer) target;
        AtomicBoolean status = new AtomicBoolean(true);
        final String containerInterfaceIP = container
            .getContainerInfo()
            .getNetworkSettings()
            .getNetworks()
            .entrySet()
            .stream()
            .findFirst()
            .get()
            .getValue()
            .getIpAddress();
        retryUntilSuccess(
            (int) startupTimeout.getSeconds(),
            TimeUnit.SECONDS,
            () -> {
                YugabyteDBYCQLWaitStrategy.this.getRateLimiter()
                    .doWhenReady(() -> {
                        try {
                            ExecResult result = container.execInContainer(
                                BIN_PATH,
                                containerInterfaceIP,
                                "-u",
                                container.getUsername(),
                                "-p",
                                container.getPassword(),
                                "-k",
                                container.getKeyspace(),
                                "-e",
                                YCQL_TEST_QUERY
                            );
                            if (result.getExitCode() != 0) {
                                status.set(false);
                                log.debug(result.getStderr());
                            }
                        } catch (Exception e) {
                            status.set(false);
                            log.debug(e.getMessage(), e);
                        } finally {
                            if (!status.getAndSet(true)) {
                                throw new RuntimeException("container hasn't come up yet");
                            }
                        }
                    });
                return status;
            }
        );
    }
Custom wait strategy for YCQL API.

<p>
Though we can either use HTTP or PORT based wait strategy, when we create a custom
keyspace/role, it gets executed asynchronously. As the wait on container.start() on a
specific port wouldn't fully guarantee the custom object execution. It's better to
check the DB status with this way with a smoke test query that uses the underlying
custom objects and wait for the operation to complete.
</p>
modules/yugabytedb/src/main/java/org/testcontainers/containers/strategy/YugabyteDBYCQLWaitStrategy.java