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

Associate a unique id with every test class object instantiated by TestNG #3079

Closed
krmahadevan opened this issue Feb 27, 2024 · 0 comments · Fixed by #3083
Closed

Associate a unique id with every test class object instantiated by TestNG #3079

krmahadevan opened this issue Feb 27, 2024 · 0 comments · Fixed by #3083
Milestone

Comments

@krmahadevan
Copy link
Member

krmahadevan commented Feb 27, 2024

Currently TestNG just instantiates an object and then it uses it internally.

Now normally this is fine, but when it comes to having to use a test class instance as a key to a map internally within TestNG we loose the ability to allow the JVM to successfully GC test class objects as and when they aren't used.

The solution for this would be that TestNG starts wrapping test class instances it produces within an object container wherein it has a unique id. So that whenever we would like to use that object as the key, we could merely use the id associated with the object as the key.

A real time usecase for this can be seen in this and this discussion.

@krmahadevan krmahadevan added this to the 7.10.0 milestone Feb 27, 2024
krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 4, 2024
krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 5, 2024
krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 5, 2024
krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 7, 2024
krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 8, 2024
krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 8, 2024
krmahadevan added a commit that referenced this issue Mar 14, 2024
* Add Unique Id for all test class instances

Closes #3079
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant