You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for contributing to the Docker-Selenium project! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Potential Race Condition The new implementation uses a polling approach to check for the existence of the named pipe and the API response. This could potentially lead to race conditions if not properly synchronized.
Error Handling The new implementation for consuming the pipe file in the background doesn't have explicit error handling. This could lead to silent failures or unexpected behavior.
Graceful Shutdown The new graceful shutdown implementation might not properly handle ongoing operations. It's important to ensure that all resources are properly released and ongoing operations are completed or safely terminated.
Use a more reliable method to check if a process is alive
The check_if_pid_alive function uses kill -0 which might not work correctly if the script is run by a user without permission to send signals to the process. Consider using the /proc filesystem instead for a more reliable check.
-if kill -0 "${pid}" > /dev/null 2>&1; then+if [[ -d "/proc/${pid}" ]]; then
return 0
fi
Apply this suggestion
Suggestion importance[1-10]: 9
Why: The suggestion improves reliability by using the /proc filesystem to check if a process is alive, which is more robust than kill -0 and avoids permission issues, making it a significant enhancement.
9
Use a more reliable method to check if the X display is open
Consider using a more robust method to check if the display is open. The current approach with xset b off might not work in all environments. Consider using xdpyinfo or a similar tool that provides more detailed information about the X display.
-until xset b off > /dev/null 2>&1+until xdpyinfo >/dev/null 2>&1
do
sleep ${poll_interval}
done
Apply this suggestion
Suggestion importance[1-10]: 8
Why: The suggestion improves robustness by using xdpyinfo, which is more reliable than xset b off for checking if the X display is open, addressing potential compatibility issues across different environments.
8
Improve API response check to handle a range of successful HTTP status codes
The check_if_api_respond function is using a hard-coded HTTP status code. It would be more robust to accept a range of successful status codes, as some APIs might return 201 or 204 for successful operations.
-if [[ "${endpoint_checks}" != "200" ]]; then+if [[ "${endpoint_checks}" -lt 200 || "${endpoint_checks}" -ge 300 ]]; then
return 1
fi
Apply this suggestion
Suggestion importance[1-10]: 7
Why: This suggestion enhances the robustness of the API response check by allowing for a range of successful HTTP status codes, which is a common practice to handle different successful responses like 201 or 204.
7
Use environment variables for configurable values to improve flexibility
Consider using a variable for the number of replicas instead of hardcoding it. This allows for easier scaling and configuration across different environments.
Why: The suggestion to use environment variables for the number of replicas enhances flexibility and scalability, making it easier to configure across different environments. However, it is not a critical change.
7
Add a limit to restart attempts for better error handling
Consider adding a startretries parameter to the video-recording program to limit the number of restart attempts in case of persistent failures.
Why: Limiting restart attempts can prevent endless restart loops in case of persistent failures, which is a good enhancement for error handling, though not critical.
6
Performance
Use multi-stage builds to reduce image size
Consider using a multi-stage build to reduce the final image size by excluding build dependencies.
Why: Using multi-stage builds is an effective way to reduce the final image size by excluding build dependencies, which can significantly improve performance and efficiency.
9
Best practice
Ensure proper server shutdown before exiting the script
The graceful_shutdown function is calling sys.exit(0) immediately after httpd.shutdown(). This might not give the server enough time to properly shut down. Consider adding a small delay or using httpd.server_close() to ensure all connections are properly closed before exiting.
def graceful_shutdown(signum, frame):
print("Trapped SIGTERM/SIGINT/x so shutting down video-ready...")
httpd.shutdown()
+ httpd.server_close()
sys.exit(0)
Apply this suggestion
Suggestion importance[1-10]: 8
Why: The suggestion ensures a more graceful shutdown by adding httpd.server_close(), which helps to properly close all connections before exiting, improving the reliability of the shutdown process.
8
Add a health check to ensure service readiness
Consider adding a health check for the chrome service to ensure it's ready before other services depend on it.
Why: Adding a health check is a best practice that ensures the service is ready before other services depend on it, improving reliability and stability.
#2629)
Currently, these variables are always overridden in the call the
wait_for_display(). Before the upgrade to ffmpeg-7.0.2 (PR #2374), the
SE_SCREEN_WIDTH and SE_SCREEN_HEIGHT variables were respected in the
case where no video uploading was done because wait_for_display() was
never called. After the upgrade to 7.0.2, it the function is always
called and overrides the VIDEO_SIZE variable.
Now, if both screen width and height are specified, the VIDEO_SIZE is
not overridden and users can control the recording size again.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Types of changes
Checklist
PR Type
Enhancement, Bug fix
Description
Changes walkthrough 📝
8 files
upload.sh
Enhance video upload script with inplace option and logging
Video/upload.sh
--inplace
option toUPLOAD_OPTS
.SE_VIDEO_INTERNAL_UPLOAD
toVIDEO_INTERNAL_UPLOAD
.video.sh
Improve video recording and upload logic
Video/video.sh
SE_VIDEO_INTERNAL_UPLOAD
toVIDEO_INTERNAL_UPLOAD
.video_graphQLQuery.sh
Add retry mechanism for GraphQL queries
Video/video_graphQLQuery.sh
video_ready.py
Add graceful shutdown to video ready server
Video/video_ready.py
helm-chart-test.yml
Update video integrity test command in workflow
.github/workflows/helm-chart-test.yml
Makefile
Update FFmpeg version and enhance test configurations
Makefile
Dockerfile
Update Dockerfile for video service with new defaults
Video/Dockerfile
SE_VIDEO_INTERNAL_UPLOAD
to true by default.SE_VIDEO_POLL_INTERVAL
environment variable.supervisord.conf
Adjust process priorities and signals in supervisord
Video/supervisord.conf
6 files
nodePreStop.sh
Ensure proper exit in node preStop script
charts/selenium-grid/configs/node/nodePreStop.sh
on_exit
function.nodeProbe.sh
Ensure proper exit in node probe script
charts/selenium-grid/configs/node/nodeProbe.sh
on_exit
function.upload.sh
Ensure proper exit in S3 upload script
charts/selenium-grid/configs/uploader/s3/upload.sh
consume_force_exit
function.docker-compose-v3-video-upload-dynamic-grid.yml
Ensure FTP server runs continuously in dynamic grid
docker-compose-v3-video-upload-dynamic-grid.yml
docker-compose-v3-video-upload-standalone.yml
Ensure FTP server runs continuously in standalone setup
docker-compose-v3-video-upload-standalone.yml
docker-compose-v3-video-upload.yml
Ensure FTP server runs continuously in video upload setup
docker-compose-v3-video-upload.yml
1 files
README.md
Update documentation for time zone and upload features
README.md