-
Notifications
You must be signed in to change notification settings - Fork 933
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
Conversation
6892168
to
2bb96a2
Compare
#region Tests setup/teardown/utils | ||
|
||
[TearDown] | ||
public async Task TearDownAsync(CancellationToken cancellationToken = default(CancellationToken)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
2bb96a2
to
0169950
Compare
0169950
to
aabee1b
Compare
@@ -157,6 +157,46 @@ protected override void OnTearDown() | |||
} | |||
|
|||
[Theory] | |||
public void CanRollbackTransaction(bool explicitFlush) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @maca88
No description provided.