Skip to content

Conversation

@bhecquet
Copy link
Contributor

Description

As discussed in issue #12234 , DefaultSlotMatcher can't be overriden is some parts of code even if 'slot-matcher' parameter is defined. This leads to situations where a slot is choosen (or rejected) based on the custom SlotMatcher, but then, when it's time to create the session, result is not the same when slot.isSupporting() is called.

Motivation and Context

This PR pushes any custom SlotMatcher everywhere DefaultSlotMatcher was hard coded. So, a new slot-matcher parameter has been added for node so that distributor/router and node have consistent behaviour.

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.
  • added a slot-matcher parameter for node. Default value is still DefaultSlotMatcher
  • make Slot, LocalNodeFactory and DockerSessionFactory use either the relevant distributor or node option to create a custom SlotMatcher

@diemol diemol added this to the 4.11 milestone Jun 22, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (7c54398) 57.40% compared to head (c64193f) 57.40%.

❗ Current head c64193f differs from pull request most recent head 4fcb806. Consider uploading reports for the commit 4fcb806 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #12240   +/-   ##
=======================================
  Coverage   57.40%   57.40%           
=======================================
  Files          86       86           
  Lines        5369     5369           
  Branches      206      206           
=======================================
  Hits         3082     3082           
  Misses       2081     2081           
  Partials      206      206           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR.

I think the code would work, but we are spreading the SlotMatcher class everywhere, and this is creating the need to serialize/de-serialize the class every time there is a Node heartbeat.

The problem is that we have put the SlotMatcher inside the Slot, and that is making things harder. I've seen that we could take out the SlotMatcher from the Slot and just pass it when the matching is needed. Let me do that change first, and I think this PR can get more compact. (A couple of conflicts will happen, sorry!)

@diemol
Copy link
Member

diemol commented Jun 28, 2023

Just pushed the changes. Ideally we only need to add the SlotMatcher to the LocalDistributor. Let me know if you need help with something.

@bhecquet bhecquet requested a review from diemol June 30, 2023 08:04
@titusfortner titusfortner added the B-grid Everything grid and server related label Jul 12, 2023
@bhecquet
Copy link
Contributor Author

Hello @diemol , is there something that blocks this PR ? I see that remote tests are failling, but looking at the logs, it seems it's not related to my changes
Or maybe, you're just on holidays 😃

Thanks

@diemol
Copy link
Member

diemol commented Jul 21, 2023

I am having less time for Selenium these days. But I will get to this before the next release.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, but somehow we have a few failing tests. I will try to check why, maybe you have an idea why based on your changes?

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @bhecquet !

@diemol diemol merged commit 53cca49 into SeleniumHQ:trunk Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-grid Everything grid and server related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: [Question] is it expected that some of the classes use DefaultSlotMatcher

4 participants