Skip to content

Commit 65933cd

Browse files
committed
fix: video container wait capabilities fully before extracting details
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent af5f36e commit 65933cd

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

Diff for: Video/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
3333
RUN apt-get -qqy update \
3434
&& apt-get upgrade -yq \
3535
&& apt-get -qqy --no-install-recommends install \
36-
supervisor x11-xserver-utils x11-utils libxcb1-dev curl jq python3-pip tzdata acl unzip python3-psutil python3-setuptools \
36+
supervisor x11-xserver-utils x11-utils libxcb1-dev curl jq python3-pip tzdata acl unzip python3-psutil \
37+
&& pip install --no-cache-dir --upgrade --break-system-packages setuptools \
3738
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
3839

3940
#===================

Diff for: Video/video_graphQLQuery.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ TEST_NAME_CAP=${TEST_NAME_CAP:-"se:name"}
1919
VIDEO_NAME_CAP=${VIDEO_NAME_CAP:-"se:videoName"}
2020
VIDEO_FILE_NAME_TRIM=${SE_VIDEO_FILE_NAME_TRIM_REGEX:-"[:alnum:]-_"}
2121
VIDEO_FILE_NAME_SUFFIX=${SE_VIDEO_FILE_NAME_SUFFIX:-"true"}
22+
poll_interval=${SE_VIDEO_POLL_INTERVAL:-1}
2223

2324
if [ -n "${GRAPHQL_ENDPOINT}" ]; then
2425
current_check=1
@@ -32,9 +33,10 @@ if [ -n "${GRAPHQL_ENDPOINT}" ]; then
3233
# Check if the response contains "capabilities"
3334
if [[ "$endpoint_checks" = "404" ]] || [[ $current_check -eq $retry_time ]]; then
3435
break
35-
elif [[ "$endpoint_checks" = "200" ]] && [[ $(jq -e '.data.session.capabilities | fromjson | ."'browserName'"' /tmp/graphQL_${SESSION_ID}.json >/dev/null) -eq 0 ]]; then
36+
elif [[ "$endpoint_checks" = "200" ]] && [[ $(jq -e '.data.session.capabilities | fromjson | ."'se:vncEnabled'"' /tmp/graphQL_${SESSION_ID}.json >/dev/null) -eq 0 ]]; then
3637
break
3738
fi
39+
sleep ${poll_interval}
3840
done
3941

4042
if [[ -f "/tmp/graphQL_${SESSION_ID}.json" ]]; then

Diff for: charts/selenium-grid/configs/distributor/distributorProbe.sh

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ SESSION_COUNT=$(curl --noproxy "*" --retry ${retry_time} -m ${max_time} -k -X PO
2626

2727
MAX_SESSION=$(curl --noproxy "*" --retry ${retry_time} -m ${max_time} -k -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { maxSession } }"}' -s ${GRID_GRAPHQL_URL} | jq -r '.data.grid.maxSession')
2828

29+
if [ "${SE_LOG_LISTEN_GRAPHQL:-"false"}" = "true" ]; then
30+
echo "$(curl --noproxy "*" --retry ${retry_time} -m ${max_time} -k -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { sessionCount, maxSession, totalSlots }, nodesInfo { nodes { id, status, sessionCount, maxSession, slotCount, stereotypes, sessions { id, capabilities, slot { id, stereotype } } } }, sessionsInfo { sessionQueueRequests } }"}' -s ${GRID_GRAPHQL_URL} )"
31+
fi
32+
2933
if [ ${SESSION_QUEUE_SIZE} -gt 0 ] && [ ${SESSION_COUNT} -eq 0 ]; then
3034
echo "$(date ${ts_format}) DEBUG [${probe_name}] - Session Queue Size: ${SESSION_QUEUE_SIZE}, Session Count: ${SESSION_COUNT}, Max Session: ${MAX_SESSION}"
3135
echo "$(date ${ts_format}) DEBUG [${probe_name}] - It seems the Distributor is delayed in processing a new session in the queue. Probe checks failed."

Diff for: tests/charts/ci/base-auth-ingress-values.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
global:
22
seleniumGrid:
33
logLevel: INFO
4-
stdoutProbeLog: false
4+
stdoutProbeLog: true
55

66
serverConfigMap:
77
env:
@@ -27,6 +27,8 @@ hub:
2727
value: "15"
2828
- name: SE_REJECT_UNSUPPORTED_CAPS
2929
value: "false"
30+
- name: SE_LOG_LISTEN_GRAPHQL
31+
value: "true"
3032

3133
components:
3234
extraEnvironmentVariables: *extraEnvironmentVariables

0 commit comments

Comments
 (0)