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

Add corner case test #11970

Merged
merged 2 commits into from
May 2, 2023
Merged

Add corner case test #11970

merged 2 commits into from
May 2, 2023

Conversation

rishav887
Copy link
Contributor

@rishav887 rishav887 commented Apr 30, 2023

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

Added some additional tests in BaseTest, HttpCommandProcessorUnitTest

Motivation and Context

HttpCommandProcessorUnitTest - Corner case test
The test ensures that all resources are correctly closed when an IOException happens during the getOutputStream() method call. This is important to prevent resource leaks that can harm system performance and cause system crashes. The test checks that the input stream, output stream, and socket are closed when an IOException occurs. By executing this test, developers can make sure that their code handles resource cleanup correctly during IOException and prevents issues from occurring in production.

BaseTest - streamlined to capture exception

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.

@CLAassistant
Copy link

CLAassistant commented Apr 30, 2023

CLA assistant check
All committers have signed the CLA.

@titusfortner
Copy link
Member

The code in the com.thoughtworks package is for the old Selenium RC conversion code. I don't think we're still distributing it?

@rishav887
Copy link
Contributor Author

if the code is still part of it then having tests can help ensure that any changes made to the code don't unintentionally break existing functionality. I feel its always better to have tests and not need them, than to need them and not have them

@titusfortner
Copy link
Member

@rishav887 sorry, I should have started by thanking you for your contribution. We appreciate it when people see things that can have more tests!

I got distracted by wondering aloud in @diemol's direction if we can get away with deleting this code entirely, or if we need to move it to a separate repo, and if we can do this now, or if we want to wait for Selenium 5.0.

@rishav887
Copy link
Contributor Author

Ah! Thats ok - thanks for acknowledging it.

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 your PR!

I can merge this to acknowledge the effort 🎉

However, this package will be deleted in the next weeks.

@diemol diemol merged commit e5805a4 into SeleniumHQ:trunk May 2, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants