Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grid] UI Overview add sort by Platform, Status, ID in oder ASC|DESC #14571

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

VietND96
Copy link
Member

@VietND96 VietND96 commented Oct 7, 2024

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Fixes #13215
By default: Sort by Platform in ascending
Updated Node card style:

  • Status DRANING: bgcolor grey.A100
  • Status DOWN: bgcolor grey.A100 && opacity 0.25

The UI looks like

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

enhancement


Description

  • Enhanced the node component to handle 'DRAINING' status, adjusting opacity and background color accordingly.
  • Implemented a sorting feature in the Overview screen, allowing users to sort nodes by platform, status, or ID in ascending or descending order.
  • Added UI controls for selecting sorting criteria and order, improving user interaction with the node list.

Changes walkthrough 📝

Relevant files
Enhancement
Node.tsx
Enhance node status handling and styling                                 

javascript/grid-ui/src/components/Node/Node.tsx

  • Added handling for 'DRAINING' node status.
  • Adjusted opacity and background color based on node status.
  • Standardized JSX attribute quoting style.
  • +13/-11 
    Overview.tsx
    Add sorting functionality to Overview screen                         

    javascript/grid-ui/src/screens/Overview/Overview.tsx

  • Implemented sorting functionality for nodes by platform, status, and
    ID.
  • Added state management for sorting options and order.
  • Introduced UI elements for selecting sort criteria and order.
  • +110/-48

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    qodo-merge-pro bot commented Oct 7, 2024

    PR Reviewer Guide 🔍

    (Review updated until commit cce6257)

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Code Duplication
    The getCardStyle function is defined inside the Node component, which may lead to unnecessary re-creation of the function on each render. Consider moving it outside the component or memoizing it.

    Performance Concern
    The sortNodes function is recreated on every render due to its dependency on sortOption and sortOrder. Consider using useCallback instead of useMemo for this function to potentially improve performance.

    Possible Bug
    The useEffect hook that sorts the nodes depends on data, sortOption, and sortOrder, but not on the sortNodes function. This might lead to unexpected behavior if sortNodes changes.

    @VietND96 VietND96 requested review from diemol and shs96c October 7, 2024 12:34
    Copy link
    Contributor

    qodo-merge-pro bot commented Oct 7, 2024

    CI Failure Feedback 🧐

    (Checks updated until commit cce6257)

    Action: Java / Remote Tests (macos) / Remote Tests (chrome, macos)

    Failed stage: Run Bazel [❌]

    Failed test name: ChromeDriverFunctionalTest-remote

    Failure summary:

    The action failed due to multiple issues encountered during the execution of the test
    ChromeDriverFunctionalTest-remote:

  • The test ChromeDriverFunctionalTest-remote failed because it encountered a
    SessionNotCreatedException while trying to start a new session with the ChromeDriver.
  • The exception was caused by a failure to create a session with the driver service, resulting in a
    response code 500 with the message "session not created".
  • There were multiple instances of HttpTimeoutException, indicating that requests timed out, which
    could be related to the failure in establishing a session.
  • The logs also mention that the Chrome browser was not reachable, which could be a contributing
    factor to the session creation failure.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  macOS
    ...
    
    682:  AccessController.doPrivileged(
    683:  ^
    684:  �[32mINFO: �[0mFrom Building external/contrib_rules_jvm~/java/src/com/github/bazel_contrib/contrib_rules_jvm/junit5/liballow.jar (1 source file):
    685:  warning: [options] source value 8 is obsolete and will be removed in a future release
    686:  warning: [options] target value 8 is obsolete and will be removed in a future release
    687:  warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    688:  �[32m[1,862 / 3,188]�[0m Extracting npm package @mui/icons-material@5.15.18_796748879; 3s disk-cache ... (4 actions, 0 running)
    689:  �[32mINFO: �[0mFrom Linking external/protobuf~/libprotobuf.a [for tool]:
    690:  /Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: bazel-out/darwin_x86_64-opt-exec-ST-d57f47055a04/bin/external/protobuf~/_objs/protobuf/error_listener.o has no symbols
    ...
    
    755:  �[32m[2,596 / 3,188]�[0m Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files); 17s disk-cache, multiplex-worker ... (4 actions, 1 running)
    756:  �[32m[2,596 / 3,188]�[0m Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files); 18s disk-cache, multiplex-worker ... (4 actions, 1 running)
    757:  �[32m[2,596 / 3,188]�[0m Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files); 19s disk-cache, multiplex-worker ... (4 actions, 1 running)
    758:  �[32m[2,596 / 3,188]�[0m Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files); 20s disk-cache, multiplex-worker ... (4 actions, 1 running)
    759:  �[32m[2,596 / 3,188]�[0m Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files); 21s disk-cache, multiplex-worker ... (4 actions, 1 running)
    760:  �[32m[2,596 / 3,188]�[0m Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files); 22s disk-cache, multiplex-worker ... (4 actions, 1 running)
    761:  �[32m[2,596 / 3,188]�[0m Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files); 23s disk-cache, multiplex-worker ... (4 actions, 1 running)
    762:  �[32mINFO: �[0mFrom Building java/src/org/openqa/selenium/remote/libapi-class.jar (71 source files):
    763:  java/src/org/openqa/selenium/remote/ErrorHandler.java:46: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    764:  private final ErrorCodes errorCodes;
    765:  ^
    766:  java/src/org/openqa/selenium/remote/ErrorHandler.java:60: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    767:  this.errorCodes = new ErrorCodes();
    768:  ^
    769:  java/src/org/openqa/selenium/remote/ErrorHandler.java:68: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    770:  public ErrorHandler(ErrorCodes codes, boolean includeServerErrors) {
    771:  ^
    772:  java/src/org/openqa/selenium/remote/Response.java:97: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    773:  ErrorCodes errorCodes = new ErrorCodes();
    774:  ^
    775:  java/src/org/openqa/selenium/remote/Response.java:97: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    776:  ErrorCodes errorCodes = new ErrorCodes();
    777:  ^
    778:  java/src/org/openqa/selenium/remote/ProtocolHandshake.java:181: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    779:  response.setStatus(ErrorCodes.SUCCESS);
    780:  ^
    781:  java/src/org/openqa/selenium/remote/ProtocolHandshake.java:182: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    782:  response.setState(ErrorCodes.SUCCESS_STRING);
    783:  ^
    784:  java/src/org/openqa/selenium/remote/W3CHandshakeResponse.java:53: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    785:  new ErrorCodes().toStatus((String) rawError, Optional.of(tuple.getStatusCode())));
    786:  ^
    787:  java/src/org/openqa/selenium/remote/W3CHandshakeResponse.java:56: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    788:  new ErrorCodes().getExceptionType((String) rawError);
    789:  ^
    790:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:44: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    791:  private final ErrorCodes errorCodes = new ErrorCodes();
    792:  ^
    793:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:44: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    794:  private final ErrorCodes errorCodes = new ErrorCodes();
    795:  ^
    796:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:55: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    797:  int status = response.getStatus() == ErrorCodes.SUCCESS ? HTTP_OK : HTTP_INTERNAL_ERROR;
    798:  ^
    799:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:101: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    800:  response.setStatus(ErrorCodes.UNKNOWN_COMMAND);
    801:  ^
    802:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:103: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    803:  response.setStatus(ErrorCodes.UNHANDLED_ERROR);
    804:  ^
    805:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:117: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    806:  response.setStatus(ErrorCodes.SUCCESS);
    807:  ^
    808:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:118: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    809:  response.setState(errorCodes.toState(ErrorCodes.SUCCESS));
    810:  ^
    811:  java/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java:124: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    812:  response.setState(errorCodes.toState(ErrorCodes.SUCCESS));
    813:  ^
    814:  java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpResponseCodec.java:70: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    815:  private final ErrorCodes errorCodes = new ErrorCodes();
    816:  ^
    817:  java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpResponseCodec.java:70: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    818:  private final ErrorCodes errorCodes = new ErrorCodes();
    819:  ^
    820:  java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpResponseCodec.java:93: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    821:  response.setStatus(ErrorCodes.UNKNOWN_COMMAND);
    822:  ^
    823:  java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpResponseCodec.java:98: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    824:  response.setStatus(ErrorCodes.UNHANDLED_ERROR);
    825:  ^
    826:  java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpResponseCodec.java:145: warning: [removal] ErrorCodes in org.openqa.selenium.remote has been deprecated and marked for removal
    827:  response.setStatus(ErrorCodes.SUCCESS);
    ...
    
    892:  �[32m[3,188 / 3,189]�[0m Testing //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote; 1687s local, disk-cache
    893:  �[32m[3,188 / 3,189]�[0m Testing //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote; 1753s local, disk-cache
    894:  �[32m[3,188 / 3,189]�[0m Testing //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote; 1819s local, disk-cache
    895:  �[32m[3,188 / 3,189]�[0m Testing //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote; 1885s local, disk-cache
    896:  �[32m[3,188 / 3,189]�[0m Testing //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote; 1951s local, disk-cache
    897:  �[32m[3,188 / 3,189]�[0m Testing //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote; 2018s local, disk-cache
    898:  �[32m[3,188 / 3,189]�[0m Testing //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote; 2084s local, disk-cache
    899:  �[31m�[1mFAIL: �[0m//java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote (see /Users/runner/.bazel/execroot/_main/bazel-out/darwin_x86_64-fastbuild/testlogs/java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest-remote/test.log)
    900:  �[31m�[1mFAILED: �[0m//java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote (Summary)
    ...
    
    966:  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
    967:  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:72)
    968:  at org.openqa.selenium.chrome.ChromeDriverInfo.createDriver(ChromeDriverInfo.java:82)
    969:  at org.openqa.selenium.remote.RemoteWebDriverBuilder.lambda$getLocalDriver$5(RemoteWebDriverBuilder.java:325)
    970:  at org.openqa.selenium.remote.RemoteWebDriverBuilder.getLocalDriver(RemoteWebDriverBuilder.java:336)
    971:  at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:364)
    972:  at org.openqa.selenium.chrome.ChromeDriverFunctionalTest.builderGeneratesDefaultChromeOptions(ChromeDriverFunctionalTest.java:59)
    973:  2) canManageNetworkConditions() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    974:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
    ...
    
    1033:  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    1034:  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    1035:  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    1036:  Caused by: java.net.http.HttpTimeoutException: request timed out
    1037:  at java.net.http/jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:63)
    1038:  at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1270)
    1039:  at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:899)
    1040:  3) builderWithClientConfigThrowsException() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    1041:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
    ...
    
    1116:  13:53:58.990 INFO [NodeOptions.report] - Adding Safari for {"browserName": "safari","platformName": "mac"} 1 times
    1117:  13:53:58.991 INFO [NodeOptions.report] - Adding Firefox for {"browserName": "firefox","platformName": "mac"} 4 times
    1118:  13:53:59.024 INFO [Node.<init>] - Binding additional locator mechanisms: relative
    1119:  13:53:59.037 INFO [GridModel.setAvailability] - Switching Node 923546e9-efac-40f3-9fa8-41e2408b7cbd (uri: http://127.0.0.1:30209) from DOWN to UP
    1120:  13:53:59.038 INFO [LocalDistributor.add] - Added node 923546e9-efac-40f3-9fa8-41e2408b7cbd at http://127.0.0.1:30209. Health check every 120s
    1121:  13:53:59.142 INFO [Standalone.execute] - Started Selenium Standalone 4.26.0-SNAPSHOT (revision Unknown): http://127.0.0.1:30209
    1122:  13:53:59.729 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
    1123:  [Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]
    1124:  13:54:59.901 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1142:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1143:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1144:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1145:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1146:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1147:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1148:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1149:  at java.base/java.lang.Thread.run(Thread.java:840)
    1150:  13:54:59.923 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1168:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1169:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1170:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1171:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1172:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1173:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1174:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1175:  at java.base/java.lang.Thread.run(Thread.java:840)
    1176:  13:54:59.925 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "aa34525f436e92cf574e38f119e74b05","eventTime": 1728309299871779161,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:11944","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom disconnected: unable to connect to renderer \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created\nfrom disconnected: unable to connect to renderer \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:162)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"goog:chromeOptions\": {\"args\": [\"disable-infobars\",\"disable-breakpad\",\"disable-dev-shm-usage\",\"no-sandbox\",\"disable-search-engine-choice-screen\"],\"extensions\": [],\"prefs\": {\"exit_type\": \"None\",\"exited_cleanly\": true}},\"platformName\": \"mac\",\"unhandledPromptBehavior\": \"ignore\",\"webSocketUrl\": true}\n"}}
    1177:  13:54:59.926 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "aa34525f436e92cf574e38f119e74b05","eventTime": 1728309299896196866,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}","session.request.downstreamdialect": "[W3C]"}}
    1178:  13:54:59.929 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "aa34525f436e92cf574e38f119e74b05","eventTime": 1728309239728845622,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]"}}
    1179:  13:54:59.929 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    1180:  from disconnected: unable to connect to renderer 
    1181:  Host info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'
    1182:  Build info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'
    1183:  System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'
    1184:  Driver info: driver.version: unknown
    1185:  Build info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'
    1186:  System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'
    1187:  Driver info: driver.version: unknown
    1188:  13:54:59.929 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1200:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1201:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1202:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1203:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1204:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1205:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1206:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1207:  at java.base/java.lang.Thread.run(Thread.java:840)
    1208:  13:54:59.930 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "aa34525f436e92cf574e38f119e74b05","eventTime": 1728309299898525065,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom disconnected: unable to connect to renderer \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom disconnected: unable to connect to renderer \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:227)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]"}}
    ...
    
    1217:  14:00:06.325 INFO [NodeOptions.report] - Adding Firefox for {"browserName": "firefox","platformName": "mac"} 4 times
    1218:  14:00:06.326 INFO [NodeOptions.report] - Adding Edge for {"browserName": "MicrosoftEdge","platformName": "mac"} 4 times
    1219:  14:00:06.367 INFO [Node.<init>] - Binding additional locator mechanisms: relative
    1220:  14:00:06.383 INFO [GridModel.setAvailability] - Switching Node 5922dc72-b5c8-4e29-a363-9affa97736fd (uri: http://127.0.0.1:32379) from DOWN to UP
    1221:  14:00:06.384 INFO [LocalDistributor.add] - Added node 5922dc72-b5c8-4e29-a363-9affa97736fd at http://127.0.0.1:32379. Health check every 120s
    1222:  14:00:06.495 INFO [Standalone.execute] - Started Selenium Standalone 4.26.0-SNAPSHOT (revision Unknown): http://127.0.0.1:32379
    1223:  14:00:06.754 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
    1224:  [Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]
    1225:  14:01:52.536 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1243:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1244:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1245:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1246:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1247:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1248:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1249:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1250:  at java.base/java.lang.Thread.run(Thread.java:840)
    1251:  14:01:52.581 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1269:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1270:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1271:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1272:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1273:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1274:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1275:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1276:  at java.base/java.lang.Thread.run(Thread.java:840)
    1277:  14:01:52.583 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "491207f975f42b5155dcd2a3227d7f97","eventTime": 1728309712535882647,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:32089","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:162)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"goog:chromeOptions\": {\"args\": [\"disable-infobars\",\"disable-breakpad\",\"disable-dev-shm-usage\",\"no-sandbox\",\"disable-search-engine-choice-screen\"],\"extensions\": [],\"prefs\": {\"exit_type\": \"None\",\"exited_cleanly\": true}},\"platformName\": \"mac\",\"unhandledPromptBehavior\": \"ignore\",\"webSocketUrl\": true}\n"}}
    1278:  14:01:52.585 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "491207f975f42b5155dcd2a3227d7f97","eventTime": 1728309712581525011,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}","session.request.downstreamdialect": "[W3C]"}}
    1279:  14:01:52.588 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "491207f975f42b5155dcd2a3227d7f97","eventTime": 1728309606754212958,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]"}}
    1280:  14:01:52.588 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    1281:  from chrome not reachable 
    1282:  Host info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'
    1283:  Build info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'
    1284:  System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'
    1285:  Driver info: driver.version: unknown
    1286:  Build info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'
    1287:  System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'
    1288:  Driver info: driver.version: unknown
    1289:  14:01:52.588 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1301:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1302:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1303:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1304:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1305:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1306:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1307:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1308:  at java.base/java.lang.Thread.run(Thread.java:840)
    1309:  14:01:52.589 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "491207f975f42b5155dcd2a3227d7f97","eventTime": 1728309712584733902,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:227)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]"}}
    1310:  14:01:52.600 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "491207f975f42b5155dcd2a3227d7f97","eventTime": 1728309712596754423,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue","http.host": "127.0.0.1:32379","http.method": "POST","http.request_content_length": "569","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession","http.user_agent": "selenium\u002f4.26.0-SNAPSHOT (java mac)"}}
    1311:  Location found is: /Users/runner/.bazel/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest-remote.runfiles/_main/java/src/org/openqa/selenium/grid/selenium_server
    1312:  14:01:55.035 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
    1313:  14:01:55.043 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
    1314:  14:01:56.060 INFO [NodeOptions.getSessionFactories] - Detected 4 available processors
    1315:  Failures: 5
    1316:  1) canExecuteCdpCommands() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    1317:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1373:  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
    1374:  at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
    1375:  at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
    1376:  at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:114)
    1377:  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
    1378:  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
    1379:  at org.openqa.selenium.chrome.ChromeDriverFunctionalTest.shouldLaunchSuccessfullyWithArabicDate(ChromeDriverFunctionalTest.java:217)
    1380:  3) builderOverridesDefaultChromeOptions() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    1381:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
    ...
    
    1418:  at org.openqa.selenium.remote.RemoteWebDriverBuilder.getLocalDriver(RemoteWebDriverBuilder.java:336)
    1419:  at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:364)
    1420:  at org.openqa.selenium.chrome.ChromeDriverFunctionalTest.builderOverridesDefaultChromeOptions(ChromeDriverFunctionalTest.java:71)
    1421:  Caused by: java.net.http.HttpTimeoutException: request timed out
    1422:  at java.net.http/jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:63)
    1423:  at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1270)
    1424:  at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:899)
    1425:  4) canManageNetworkConditions() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    1426:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1572:  14:15:12.512 INFO [NodeOptions.report] - Adding Edge for {"browserName": "MicrosoftEdge","platformName": "mac"} 4 times
    1573:  14:15:12.513 INFO [NodeOptions.report] - Adding Chrome for {"browserName": "chrome","platformName": "mac"} 4 times
    1574:  14:15:12.557 INFO [Node.<init>] - Binding additional locator mechanisms: relative
    1575:  14:15:12.575 INFO [GridModel.setAvailability] - Switching Node c1192bcd-744e-4245-ae51-f38d1db06136 (uri: http://127.0.0.1:11904) from DOWN to UP
    1576:  14:15:12.576 INFO [LocalDistributor.add] - Added node c1192bcd-744e-4245-ae51-f38d1db06136 at http://127.0.0.1:11904. Health check every 120s
    1577:  14:15:12.688 INFO [Standalone.execute] - Started Selenium Standalone 4.26.0-SNAPSHOT (revision Unknown): http://127.0.0.1:11904
    1578:  14:15:12.954 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
    1579:  [Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]
    1580:  14:17:21.624 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1618:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1619:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1620:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1621:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1622:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1623:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1624:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1625:  at java.base/java.lang.Thread.run(Thread.java:840)
    1626:  14:17:21.655 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    1627:  from chrome not reachable 
    1628:  Host info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'
    1629:  Build info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'
    1630:  System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'
    1631:  Driver info: driver.version: unknown
    1632:  14:17:21.657 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "799eca899edded787c9c629238002e75","eventTime": 1728310641625163053,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:32002","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:162)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"goog:chromeOptions\": {\"args\": [\"disable-infobars\",\"disable-breakpad\",\"disable-dev-shm-usage\",\"no-sandbox\",\"disable-search-engine-choice-screen\"],\"extensions\": [],\"prefs\": {\"exit_type\": \"None\",\"exited_cleanly\": true}},\"platformName\": \"mac\",\"unhandledPromptBehavior\": \"ignore\",\"webSocketUrl\": true}\n"}}
    1633:  14:17:21.659 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "799eca899edded787c9c629238002e75","eventTime": 1728310641658576445,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}","session.request.downstreamdialect": "[W3C]"}}
    1634:  14:17:21.661 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "799eca899edded787c9c629238002e75","eventTime": 1728310512953970354,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]"}}
    1635:  14:17:21.662 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1647:  at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    1648:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)
    1649:  at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)
    1650:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)
    1651:  at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)
    1652:  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    1653:  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    1654:  at java.base/java.lang.Thread.run(Thread.java:840)
    1655:  14:17:21.662 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    1656:  from chrome not reachable 
    1657:  Host info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'
    1658:  Build info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'
    1659:  System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'
    1660:  Driver info: driver.version: unknown
    1661:  Build info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'
    1662:  System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'
    1663:  Driver info: driver.version: unknown
    1664:  14:17:21.662 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "799eca899edded787c9c629238002e75","eventTime": 1728310641661420700,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom chrome not reachable \nHost info: host: 'Mac-1728307749706.local', ip: 'fe80:0:0:0:4c8:11ba:b223:aaf8%en0'\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.26.0-SNAPSHOT', revision: 'Unknown'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '13.7', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:227)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:654)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:573)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:836)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:793)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-infobars, disable-breakpad, disable-dev-shm-usage, no-sandbox, disable-search-engine-choic...], extensions: [], prefs: {exit_type: None, exited_cleanly: true}}, unhandledPromptBehavior: ignore, webSocketUrl: true}]"}}
    ...
    
    1707:  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
    1708:  at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
    1709:  at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
    1710:  at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:114)
    1711:  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
    1712:  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
    1713:  at org.openqa.selenium.chrome.ChromeDriverFunctionalTest.shouldLaunchSuccessfullyWithArabicDate(ChromeDriverFunctionalTest.java:217)
    1714:  3) builderOverridesDefaultChromeOptions() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    1715:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
    ...
    
    1752:  at org.openqa.selenium.remote.RemoteWebDriverBuilder.getLocalDriver(RemoteWebDriverBuilder.java:336)
    1753:  at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:364)
    1754:  at org.openqa.selenium.chrome.ChromeDriverFunctionalTest.builderOverridesDefaultChromeOptions(ChromeDriverFunctionalTest.java:71)
    1755:  Caused by: java.net.http.HttpTimeoutException: request timed out
    1756:  at java.net.http/jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:63)
    1757:  at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1270)
    1758:  at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:899)
    1759:  4) canManageNetworkConditions() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    1760:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
    ...
    
    1819:  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    1820:  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    1821:  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    1822:  Caused by: java.net.http.HttpTimeoutException: request timed out
    1823:  at java.net.http/jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:63)
    1824:  at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1270)
    1825:  at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:899)
    1826:  5) builderWithClientConfigThrowsException() (org.openqa.selenium.chrome.ChromeDriverFunctionalTest)
    1827:  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created
    ...
    
    1866:  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    1867:  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    1868:  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    1869:  ================================================================================
    1870:  �[32mINFO: �[0mFound 1 test target...
    1871:  Target //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote up-to-date:
    1872:  bazel-bin/java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest-remote
    1873:  bazel-bin/java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest-remote.jar
    1874:  �[32m[3,189 / 3,189]�[0m 1 / 1 tests, �[31m�[1m1 failed�[0m;�[0m checking cached actions
    1875:  �[32mINFO: �[0mElapsed time: 2231.734s, Critical Path: 2151.42s
    1876:  �[32mINFO: �[0m2896 processes: 1702 disk cache hit, 1126 internal, 62 darwin-sandbox, 5 local, 1 worker.
    1877:  �[32mINFO: �[0mBuild completed, 1 test FAILED, 2896 total actions
    1878:  //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote �[0m�[31m�[1mFAILED�[0m in 3 out of 3 in 914.3s
    1879:  Stats over 3 runs: max = 914.3s, min = 574.7s, avg = 696.0s, dev = 154.7s
    1880:  /Users/runner/.bazel/execroot/_main/bazel-out/darwin_x86_64-fastbuild/testlogs/java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest-remote/test.log
    1881:  /Users/runner/.bazel/execroot/_main/bazel-out/darwin_x86_64-fastbuild/testlogs/java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest-remote/test_attempts/attempt_1.log
    1882:  /Users/runner/.bazel/execroot/_main/bazel-out/darwin_x86_64-fastbuild/testlogs/java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest-remote/test_attempts/attempt_2.log
    1883:  Executed 1 out of 1 test: �[0m�[31m�[1m1 fails locally�[0m.
    1884:  �[0m
    1885:  ##[error]Process completed with exit code 3.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
    @VietND96
    Copy link
    Member Author

    VietND96 commented Oct 7, 2024

    /review

    Copy link
    Contributor

    qodo-merge-pro bot commented Oct 7, 2024

    Persistent review updated to latest commit cce6257

    @VietND96
    Copy link
    Member Author

    VietND96 commented Oct 7, 2024

    /improve

    Copy link
    Contributor

    qodo-merge-pro bot commented Oct 7, 2024

    PR Code Suggestions ✨

    Latest suggestions up to cce6257

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Use TypeScript's discriminated unions for improved type safety of the sortOption state

    Consider using TypeScript's discriminated unions for the sortOption state to improve
    type safety and prevent potential runtime errors.

    javascript/grid-ui/src/screens/Overview/Overview.tsx [51]

    -const [sortOption, setSortOption] = useState('osInfo.name')
    +type SortOption = 'osInfo.name' | 'status' | 'id';
    +const [sortOption, setSortOption] = useState<SortOption>('osInfo.name');
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: Using discriminated unions for the sortOption state enhances type safety, reducing the risk of runtime errors. This is a best practice in TypeScript, ensuring that only valid sort options are used.

    9
    Performance
    Move the sortProperties object outside the component to prevent unnecessary re-creation

    The sortProperties object could be defined outside the component to prevent
    unnecessary re-creation on each render. This would improve performance, especially
    for larger applications.

    javascript/grid-ui/src/screens/Overview/Overview.tsx [65-69]

     const sortProperties = {
    -  'osInfo.name': (a, b) => a.osInfo.name.localeCompare(b.osInfo.name),
    -  'status': (a, b) => a.status.localeCompare(b.status),
    -  'id': (a, b) => (a.id < b.id ? -1 : 1)
    +  'osInfo.name': (a: NodeInfo, b: NodeInfo) => a.osInfo.name.localeCompare(b.osInfo.name),
    +  'status': (a: NodeInfo, b: NodeInfo) => a.status.localeCompare(b.status),
    +  'id': (a: NodeInfo, b: NodeInfo) => (a.id < b.id ? -1 : 1)
    +};
    +
    +function Overview (): JSX.Element {
    +  // ... rest of the component
     }
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Moving the sortProperties object outside the component scope reduces unnecessary re-creation on each render, improving performance. This is particularly useful in larger applications where performance can be impacted by frequent re-renders.

    8
    Optimize the sortNodes function to prevent unnecessary recreations on each render

    The sortNodes function is recreated on every render due to its dependency on
    sortOption and sortOrder. Consider moving it outside the component or memoizing it
    with useCallback to optimize performance.

    javascript/grid-ui/src/screens/Overview/Overview.tsx [71-76]

    -const sortNodes = useMemo(() => {
    -  return (nodes: NodeInfo[], option: string, order: number) => {
    -    const sortFn = sortProperties[option] || (() => 0)
    -    return nodes.sort((a, b) => order * sortFn(a, b))
    -  }
    -}, [sortOption, sortOrder])
    +const sortNodes = useCallback((nodes: NodeInfo[], option: string, order: number) => {
    +  const sortFn = sortProperties[option] || (() => 0);
    +  return [...nodes].sort((a, b) => order * sortFn(a, b));
    +}, []);
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Memoizing the sortNodes function with useCallback prevents unnecessary recreations on each render, optimizing performance. This is a valuable improvement for maintaining efficient rendering in the component.

    8
    Enhancement
    Extract inline styles into a separate constant for improved maintainability and easier theming

    Consider extracting the inline styles in the getCardStyle function into a separate
    constant or theme object. This would improve maintainability and allow for easier
    theming across the application.

    javascript/grid-ui/src/components/Node/Node.tsx [27-32]

    +const NODE_STYLES = {
    +  base: {
    +    height: '100%',
    +    flexGrow: 1,
    +  },
    +  down: {
    +    opacity: 0.25,
    +    bgcolor: 'grey.A100',
    +  },
    +  draining: {
    +    bgcolor: 'grey.A100',
    +  },
    +};
    +
     const getCardStyle = (status: string) => ({
    -  height: '100%',
    -  flexGrow: 1,
    -  opacity: status === 'DOWN' ? 0.25 : 1,
    -  bgcolor: (status === 'DOWN' || status === 'DRAINING') ? 'grey.A100' : ''
    -})
    +  ...NODE_STYLES.base,
    +  ...(status === 'DOWN' ? NODE_STYLES.down : {}),
    +  ...(status === 'DRAINING' ? NODE_STYLES.draining : {}),
    +});
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Extracting inline styles into a separate constant improves maintainability and allows for easier theming, which is beneficial for larger projects. This suggestion is accurate and enhances the code structure without altering functionality.

    7

    Previous suggestions

    Suggestions up to commit f375eeb
    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Simplify the sorting function by using a mapping object for sort options, reducing complexity and improving maintainability

    The sortNodes function can be simplified by using a mapping object for sort options,
    reducing the number of if-else statements and improving maintainability.

    javascript/grid-ui/src/screens/Overview/Overview.tsx [65-76]

    +const sortOptions = {
    +  'osInfo.name': (a, b) => a.osInfo.name.localeCompare(b.osInfo.name),
    +  'status': (a, b) => a.status.localeCompare(b.status),
    +  'id': (a, b) => (a.id < b.id ? -1 : 1)
    +};
    +
     const sortNodes = (nodes: NodeInfo[], option: string) => {
    -  return nodes.sort((a, b) => {
    -    if (option === 'osInfo.name') {
    -      return sortOrder * a.osInfo.name.localeCompare(b.osInfo.name)
    -    } else if (option === 'status') {
    -      return sortOrder * a.status.localeCompare(b.status)
    -    } else if (option === 'id') {
    -      return sortOrder * (a.id < b.id ? -1 : 1)
    -    }
    -    return 0
    -  })
    +  const sortFn = sortOptions[option] || (() => 0);
    +  return nodes.sort((a, b) => sortOrder * sortFn(a, b));
     }
    Suggestion importance[1-10]: 8

    Why: The suggestion effectively reduces complexity by using a mapping object, which enhances maintainability and readability of the sorting logic.

    8
    Extract complex conditional styling logic into a separate function for improved readability and maintainability

    Consider extracting the complex conditional logic for opacity and background color
    into a separate function for better readability and maintainability.

    javascript/grid-ui/src/components/Node/Node.tsx [31-37]

    -<Card
    -  sx={{
    -    height: '100%',
    -    flexGrow: 1,
    -    opacity: nodeStatusDown ? 0.25 : 1,
    -    bgcolor: (nodeStatusDown || nodeStatusDraining) ? 'grey.A100' : ''
    -  }}
    ->
    +const getCardStyle = (status) => ({
    +  height: '100%',
    +  flexGrow: 1,
    +  opacity: status === 'DOWN' ? 0.25 : 1,
    +  bgcolor: (status === 'DOWN' || status === 'DRAINING') ? 'grey.A100' : ''
    +});
     
    +<Card sx={getCardStyle(node.status)}>
    +
    Suggestion importance[1-10]: 7

    Why: This suggestion improves code readability and maintainability by encapsulating complex styling logic into a separate function, making it easier to manage and understand.

    7
    Best practice
    Use TypeScript's discriminated unions for more type-safe handling of sort options

    Consider using TypeScript's discriminated unions for more type-safe handling of
    different sort options, which can help catch potential errors at compile-time.

    javascript/grid-ui/src/screens/Overview/Overview.tsx [56-58]

    +type SortOption = 'osInfo.name' | 'status' | 'id';
    +
     const handleSortChange = (event: React.ChangeEvent<{ value: unknown }>) => {
    -  setSortOption(event.target.value as string)
    +  setSortOption(event.target.value as SortOption)
     }
    Suggestion importance[1-10]: 7

    Why: This suggestion enhances type safety by using discriminated unions, which can help catch potential errors at compile-time, improving code robustness.

    7
    Performance
    Memoize the sorting function to optimize performance for large lists of nodes

    Consider memoizing the sortNodes function using useMemo to optimize performance,
    especially for large lists of nodes.

    javascript/grid-ui/src/screens/Overview/Overview.tsx [65-76]

    -const sortNodes = (nodes: NodeInfo[], option: string) => {
    -  return nodes.sort((a, b) => {
    -    if (option === 'osInfo.name') {
    -      return sortOrder * a.osInfo.name.localeCompare(b.osInfo.name)
    -    } else if (option === 'status') {
    -      return sortOrder * a.status.localeCompare(b.status)
    -    } else if (option === 'id') {
    -      return sortOrder * (a.id < b.id ? -1 : 1)
    -    }
    -    return 0
    -  })
    -}
    +const sortNodes = useMemo(() => {
    +  return (nodes: NodeInfo[], option: string) => {
    +    return nodes.sort((a, b) => {
    +      if (option === 'osInfo.name') {
    +        return sortOrder * a.osInfo.name.localeCompare(b.osInfo.name)
    +      } else if (option === 'status') {
    +        return sortOrder * a.status.localeCompare(b.status)
    +      } else if (option === 'id') {
    +        return sortOrder * (a.id < b.id ? -1 : 1)
    +      }
    +      return 0
    +    })
    +  }
    +}, [sortOrder])
    Suggestion importance[1-10]: 6

    Why: Memoizing the sorting function can improve performance, especially for large datasets, by preventing unnecessary recalculations, though the impact depends on the specific use case.

    6

    @VietND96 VietND96 merged commit 64ed1e1 into trunk Oct 7, 2024
    25 of 29 checks passed
    @VietND96 VietND96 deleted the grid-ui-sort branch October 7, 2024 15:15
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    [🚀 Feature]: [selenium grid] grid web page sorted by platform
    2 participants