Skip to content

Upgrade AsyncGenerator to 0.6.0 #1426

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

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

hazzik
Copy link
Member

@hazzik hazzik commented Nov 5, 2017

No description provided.

@hazzik hazzik force-pushed the AsyncGenerator-0.6.0 branch from 6892168 to 2bb96a2 Compare November 5, 2017 21:44
#region Tests setup/teardown/utils

[TearDown]
public async Task TearDownAsync(CancellationToken cancellationToken = default(CancellationToken))
Copy link
Member Author

Choose a reason for hiding this comment

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

@maca88 methods wit TearDownAttribute are specified as being copied. Why did it generate the Async?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is related to this issue. Copying a method for a partial class would cause a compilation error as the method would be duplicated. Probably, what you want here is to mark all classes with ExplicitAttribute to be generated as a new type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, the solution was to apply [TestFixture] attribute. Thanks for the tip.

@hazzik hazzik force-pushed the AsyncGenerator-0.6.0 branch from 2bb96a2 to 0169950 Compare November 6, 2017 20:52
@hazzik hazzik force-pushed the AsyncGenerator-0.6.0 branch from 0169950 to aabee1b Compare November 6, 2017 21:29
@hazzik hazzik merged commit b29ec23 into nhibernate:master Nov 7, 2017
@hazzik hazzik deleted the AsyncGenerator-0.6.0 branch November 7, 2017 04:28
@@ -157,6 +157,46 @@ protected override void OnTearDown()
}

[Theory]
public void CanRollbackTransaction(bool explicitFlush)
Copy link
Member

Choose a reason for hiding this comment

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

A bunch of synchronous tests are now duplicated in the async class.

@@ -207,6 +247,38 @@ protected override void OnTearDown()
}

[Theory]
[Description("Another action inside the transaction do the rollBack outside nh-session-scope.")]
public void RollbackOutsideNh(bool explicitFlush)
Copy link
Member

Choose a reason for hiding this comment

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

Duplicated synchronous test.

@@ -259,6 +331,37 @@ protected override void OnTearDown()
}

[Theory]
[Description("rollback inside nh-session-scope should not commit save and the transaction should be aborted.")]
public void TransactionInsertWithRollBackTask(bool explicitFlush)
Copy link
Member

Choose a reason for hiding this comment

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

Duplicated synchronous test.

[Description(@"Two session in two txscope
(without an explicit NH transaction)
and with a rollback in the second dtc and a ForceRollback outside nh-session-scope.")]
public void TransactionInsertLoadWithRollBackTask(bool explicitFlush)
Copy link
Member

@fredericDelaporte fredericDelaporte Nov 7, 2017

Choose a reason for hiding this comment

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

Fourth duplicated synchronous test.

This are the ones called by MultiThreadedTransaction test, but there should not be copied here in async, since MultiThreadedTransaction is not there either. It looks like a regression of the async generator.

@maca88 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bug, thanks for discovering it. By ignoring the MultiThreadRunner class, the calculation for the method conversion fails to calculate the the correct conversion in this case. I've made an issue, with a simple test case demonstrating the bug. The old version would also not work in this case. In order to fix it I will have to revisit the method conversion logic and find a better way to calculate the final conversion. I will post here once it is fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

With the version 0.6.1, the mentioned synchronous tests are not generated anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @maca88

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