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

Should not we use the lock everywhere suiteResult is used? #3078

Closed
krmahadevan opened this issue Feb 26, 2024 · 1 comment · Fixed by #3099
Closed

Should not we use the lock everywhere suiteResult is used? #3078

krmahadevan opened this issue Feb 26, 2024 · 1 comment · Fixed by #3099
Milestone

Comments

@krmahadevan
Copy link
Member

          @krmahadevan Should not we use the lock everywhere suiteResult is used?

Originally posted by @juherr in #3077 (comment)

@krmahadevan
Copy link
Member Author

One of the requirements of this issue is to ascertain thread safety and data modification concerns around suiteResult within SuiteRunner

krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 21, 2024
Closes testng-team#3078

Following changes were made:

* Removed the lock based synchronization around 
SuiteResult because it’s already backed by a 
SynchronizedMap from Collections.
* Altered the getter such that it returns back a
regular linkedHashMap (without the synchronisation
Because users are expected ONLY to iterate on it and
NOT change its state)
* Also just to ensure that users don’t garble the 
Suite result, wrapping it with an UnModifiableMap
@krmahadevan krmahadevan added this to the 7.10.0 milestone Mar 21, 2024
krmahadevan added a commit to krmahadevan/testng that referenced this issue Mar 22, 2024
Closes testng-team#3078

Following changes were made:

* Removed the lock based synchronization around 
SuiteResult because it’s already backed by a 
SynchronizedMap from Collections.
* Altered the getter such that it returns back a
regular linkedHashMap (without the synchronisation
Because users are expected ONLY to iterate on it and
NOT change its state)
* Also just to ensure that users don’t garble the 
Suite result, wrapping it with an UnModifiableMap
krmahadevan added a commit that referenced this issue Mar 22, 2024
Closes #3078

Following changes were made:

* Removed the lock based synchronization around 
SuiteResult because it’s already backed by a 
SynchronizedMap from Collections.
* Altered the getter such that it returns back a
regular linkedHashMap (without the synchronisation
Because users are expected ONLY to iterate on it and
NOT change its state)
* Also just to ensure that users don’t garble the 
Suite result, wrapping it with an UnModifiableMap
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