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

Fix SetSnapShot CopyTo variance failure #3304

Merged

Conversation

fredericDelaporte
Copy link
Member

This failure causes tests to fail when upgrading the NUnit engine.

@bahusoid
Copy link
Member

ICollection.CopyTo implementation is broken by #2394
Shouldn't it be treated as 5.3 regression?

@hazzik
Copy link
Member

hazzik commented May 15, 2023

I've added test for the incompatible array type. .NET 4.x and .NET Core behave differently. The .NET 4.x throws ArgumentException while .NET Core throws InvalidCastException. Not sure if we need/want to make this consistent.

@fredericDelaporte
Copy link
Member Author

While technically a regression from 5.3.0, SetSnapShot is an internal technical class which NHibernate current internal uses do not suffer from the introduced bug. So, it appears there is no regression from an user standpoint. Only the NHibernate.Test project has an issue with this "regression", and only if upgrading our testing framework, which works on that internal class.

That is why targeting master seems enough to me. But why not targeting 5.3.x.

About:

I've added test for the incompatible array type. .NET 4.x and .NET Core behave differently. The .NET 4.x throws ArgumentException while .NET Core throws InvalidCastException. Not sure if we need/want to make this consistent.

I do not see a need for that, due to this class being internal and having its current use cases without a possibility of triggering these exceptions.

@hazzik
Copy link
Member

hazzik commented May 16, 2023

I do not see a need for that

Sure. Feel free to drop my test then.

@bahusoid
Copy link
Member

is an internal technical class which NHibernate current internal uses do not suffer from the introduced bug

Yeah but it's still exposed to user via IPersistentCollection.GetSnapshot call. I think it's worth fixing at least in 5.4.

@fredericDelaporte fredericDelaporte changed the base branch from master to 5.3.x May 16, 2023 16:08
@fredericDelaporte
Copy link
Member Author

Since instances of that type can after all be accessed by user code through a public interface (which I had not spotted), re-targeted to 5.3.x, invalid array test adapted to accept the .Net Core case as it is currently.

@fredericDelaporte fredericDelaporte modified the milestones: 5.5, 5.3.17 May 16, 2023
@hazzik hazzik closed this May 18, 2023
@hazzik hazzik reopened this May 18, 2023
@hazzik
Copy link
Member

hazzik commented May 18, 2023

Closed and opened PR to fix wrong target on Generate Async code

@fredericDelaporte fredericDelaporte merged commit c49a2a9 into nhibernate:5.3.x May 19, 2023
@fredericDelaporte fredericDelaporte deleted the setSnapShot-copyTo branch May 19, 2023 21:14
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.

3 participants