C#5 async tests are not supported
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Fix Released
|
High
|
Charlie Poole | ||
NUnit V2 |
Fix Released
|
Wishlist
|
Simone Busoli | ||
NUnitLite |
Fix Released
|
High
|
Charlie Poole |
Bug Description
If a method is marked async, nunit does not recognise it as a test, and some test runners may incorrectly pass it while it is still running. These methods actually return a Task not void, and the test can only be passed if the task completes without a failure.
As detailed here http://
MSTest supports async tests
http://
Related branches
- Charlie Poole: Approve
-
Diff: 4772 lines (+2739/-1381)54 files modifiedapiNUnitTests.v3.nunit (+15/-0)
build.bat (+124/-122)
nunit.sln (+280/-266)
scripts/nunit.build.targets (+5/-1)
scripts/nunit.common.targets (+11/-1)
scripts/nunit.package.targets (+2/-0)
src/ClientUtilities/util/ProcessRunner.cs (+2/-2)
src/ClientUtilities/util/RuntimeFrameworkSelector.cs (+4/-3)
src/ClientUtilities/util/Services/TestAgency.cs (+4/-4)
src/ConsoleRunner/nunit-console/ConsoleUi.cs (+6/-4)
src/GuiException/tests/Controls/TestCodeBox.cs (+1/-1)
src/GuiException/tests/Controls/TestErrorBrowser.cs (+1/-1)
src/GuiException/tests/Controls/TestErrorList.cs (+1/-1)
src/GuiException/tests/Controls/TestErrorToolbar.cs (+1/-1)
src/GuiException/tests/Controls/TestSourceCodeDisplay.cs (+1/-1)
src/NUnitCore/core/AsyncSynchronizationContext.cs (+45/-0)
src/NUnitCore/core/Builders/NUnitTestCaseBuilder.cs (+432/-421)
src/NUnitCore/core/NUnitAsyncTestMethod.cs (+79/-0)
src/NUnitCore/core/NUnitTestMethod.cs (+5/-5)
src/NUnitCore/core/Reflect.cs (+10/-1)
src/NUnitCore/core/TestMethod.cs (+33/-30)
src/NUnitCore/core/TestSuite.cs (+1/-2)
src/NUnitCore/core/nunit.core.build (+2/-0)
src/NUnitCore/core/nunit.core.dll.csproj (+227/-225)
src/NUnitCore/interfaces/RuntimeFramework.cs (+2/-0)
src/NUnitCore/tests-net45/NUnitAsyncTestMethodTests.cs (+109/-0)
src/NUnitCore/tests-net45/NUnitTestCaseBuilderTests.cs (+108/-0)
src/NUnitCore/tests-net45/nunit.core.tests.net45.build (+48/-0)
src/NUnitCore/tests-net45/nunit.core.tests.net45.csproj (+84/-0)
src/NUnitCore/tests/CoreExtensionsTests.cs (+2/-2)
src/NUnitCore/tests/DatapointTests.cs (+1/-1)
src/NUnitCore/tests/PlatformDetectionTests.cs (+14/-5)
src/NUnitCore/tests/RuntimeFrameworkTests.cs (+4/-3)
src/NUnitCore/tests/TestRunnerThreadTests.cs (+1/-1)
src/NUnitCore/tests/nunit.core.tests.csproj (+255/-253)
src/NUnitFramework/tests/CollectionAssertTest.cs (+1/-1)
src/NUnitFramework/tests/Constraints/CollectionConstraintTests.cs (+3/-3)
src/NUnitFramework/tests/Constraints/ComparisonConstraintTests.cs (+2/-2)
src/NUnitFramework/tests/Constraints/EqualConstraintTests.cs (+2/-2)
src/NUnitFramework/tests/Syntax/ArbitraryConstraintMatching.cs (+1/-1)
src/NUnitFramework/tests/Syntax/ThrowsTests.cs (+1/-1)
src/ProjectEditor/tests/Presenters/AddConfigurationPresenterTests.cs (+1/-1)
src/ProjectEditor/tests/Presenters/ConfigurationEditorTests.cs (+1/-1)
src/ProjectEditor/tests/Presenters/MainPresenterTests.cs (+1/-1)
src/ProjectEditor/tests/Presenters/PropertyPresenterTests.cs (+1/-1)
src/ProjectEditor/tests/Presenters/RenameConfigurationPresenterTests.cs (+1/-1)
src/ProjectEditor/tests/Presenters/SelectionStub.cs (+1/-1)
src/ProjectEditor/tests/Presenters/XmlPresenterTests.cs (+1/-1)
src/tests/test-assembly-net45/AsyncDummyFixture.cs (+56/-0)
src/tests/test-assembly-net45/AsyncRealFixture.cs (+289/-0)
src/tests/test-assembly-net45/test-assembly-net45.build (+42/-0)
src/tests/test-assembly-net45/test-assembly-net45.csproj (+72/-0)
src/tests/test-assembly/DatapointFixture.cs (+1/-1)
tools/nant/bin/NAnt.exe.config (+342/-6)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #1 |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #2 |
Anthony, although this is certainly currently not handled at all in NUnit, if I recall correctly R# emulates NUnit and doesn't use it directly, so I would say that your tests should first be run using an official NUnit runner, like the console or the gui, in order to validate this bug.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : Re: [Bug 1057981] Re: C#5 async tests are not supported | #3 |
Purely out of interest for the interesting, Simone, can I tag along, too? I
have a few doubts on the new implementation of the new CLR (Server GC)
background GC and a separate GC thread for each processor plus the work
stealing mode (no pun), which may also come into play in this scenario.
Regards,
Jv
On Fri, Sep 28, 2012 at 2:43 PM, Simone Busoli
<email address hidden>wrote:
> I believe this deserves implementing.
>
> Charlie, do you mind if I look into it?
>
> --
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit V2 Test Framework:
> New
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
--
Regards,
Ravichandran Jv
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #4 |
Hi Jv, sure, I was just proposing myself as a way to have this out soon, but I certainly don't mind if you would like to take over.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #5 |
No, not take over but help you with by pairing?
I am recovering from an arm injury so please note that I may be slow as a
pairing partner! :)
Jv
On Fri, Sep 28, 2012 at 3:19 PM, Simone Busoli
<email address hidden>wrote:
> Hi Jv, sure, I was just proposing myself as a way to have this out soon,
> but I certainly don't mind if you would like to take over.
>
> --
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit V2 Test Framework:
> New
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
--
Regards,
Ravichandran Jv
http://
Changed in nunitv2: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
assignee: | nobody → Simone Busoli (simone.busoli) |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #6 |
I marked this triaged (since I know we don't have the feature) and assigned it to Simone. I'm also changing the bug to target NUnitLite and NUnit 3.0.
Since our build of NUnit 2.6 targets .NET 2.0, this isn't really a suitable feature to add there, which leaves the question of where to best work on it...
NUnitLite currently has an experimental Asynchronous attribute, which allows other tests to be run while the marked test continues on a separate thread. Implementing this required a _lot_ of changes to how tests are executed, which is why I really don't think we should do it in the 2.6 series. Since NUnitLite is built for multiple platforms it would be relatively simple to support the use of an async method without requiring the attribute in the .NET 4.5 build - which you would have to add.
NUnit 3.0 has a branch (currently not published) where all tests may be run in parallel. It's not yet clear to me whether we really need any special handling for async tests in this environment. On the one hand, a single async test would not have any impact on execution of other tests so long as the maximum number of runners was not exceeded. On the other hand, people are probably using async (at least some of the time) on methods that have to wait for long-running operations that don't use the cpu, so we might like the runner thread to be freed up for another test while that wait takes place.
Between the two projects, I think that NUnitLite is the easiest place to begin since it's all in a single assembly. If you have to make changes to the basic execution of tests (found under framework\
affects: | nunitv2 → nunit-3.0 |
Changed in nunitlite: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
assignee: | nobody → Simone Busoli (simone.busoli) |
importance: | Wishlist → High |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #7 |
I upgraded NUnitLite fix to High priority because it would enable us to support async methods in the NUnit test adapter that runs under VS 2012. That adapter is currently based on the full NUnit framework, but I was planning to switch it over to NUnitLite as soon as the latter reached feature parity with NUnit.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #8 |
Charlie, I think this bug is not about asynchronous tests, but rather about
correct handling of tests which have to be marked as async because they use
the new .NET 4.5 async/await features, which is a different matter as far
as I understand.
Also, I'm not completely sure that although this feature has been
introduced in .NET 4.5 it cannot be handled somehow in CLR 2.0, but I will
have to check further as I'm not overly familiar with the brand new
features.
In any case, it would be quite good if this was possible to handle it in
NUnit 2.x which is the current released version, as users otherwise would
have to wait until 3.0 is out or switch to NUnitLite, which if I were a
user I would like to not need to do.
If not possible then the workaround is quite simple and just requires the
users to Wait on the task by caling its waiting method, rather than
"awaiting" it.
On Fri, Sep 28, 2012 at 5:26 PM, Charlie Poole <email address hidden> wrote:
> I upgraded NUnitLite fix to High priority because it would enable us to
> support async methods in the NUnit test adapter that runs under VS 2012.
> That adapter is currently based on the full NUnit framework, but I was
> planning to switch it over to NUnitLite as soon as the latter reached
> feature parity with NUnit.
>
> --
> You received this bug notification because you are a bug assignee.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Anthony Steele (anthony-steele) wrote : | #9 |
Simone is correct here. This is all about the Task type, which was present in C#4. It may be enough to allow tasks with this return type, wait for the task to complete and check for exceptions.
This comment from Eric Lippert http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #10 |
@Simone:
I'm OK with your experimenting with this to see if something can be done. We can add NUnitV2 back to the affected projects if it turns out to be relatively simple: i.e.: if we don't have to change the basically sequential execution pattern that is implemented in NUnit 2.6.
However, I did point out in the StackOverflow thread that there is lots you can already do in NUnit with asynchronous calls, provided you don't expect NUnit to recognize async tests. So long as the user does an await in the test, there won't be an issue as far as I can tell. Perhaps you should first check me on that.
@Anthony:
Since NUnit 2.x is built targeting .NET 2.0, I'm not sure how a Task return type would help us. Can you clarify?
@everyone:
Frankly, I'd rather hurry up with NUnit 3.0 than spend time on a half-a**ed fix of NUnit 2.6.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #11 |
A further note based on my readings...
Since you can't await a method that returns async void, and since NUnit attaches a special meaning to any value that is returned by the test method, we'll have to somehow allow for that either by disallowing checking the return value on an async test method or awaiting the task and then checking the actual return value in some way.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #12 |
I agree Charlie, I'm not aware of the current status of V3 so I just
assumed it was not ready for prime time, but if it makes sense to add it
there then it's probably going to be easier by far.
Simone
On Fri, Sep 28, 2012 at 6:20 PM, Charlie Poole <email address hidden> wrote:
> @Simone:
>
> I'm OK with your experimenting with this to see if something can be
> done. We can add NUnitV2 back to the affected projects if it turns out
> to be relatively simple: i.e.: if we don't have to change the basically
> sequential execution pattern that is implemented in NUnit 2.6.
>
> However, I did point out in the StackOverflow thread that there is lots
> you can already do in NUnit with asynchronous calls, provided you don't
> expect NUnit to recognize async tests. So long as the user does an await
> in the test, there won't be an issue as far as I can tell. Perhaps you
> should first check me on that.
>
> @Anthony:
>
> Since NUnit 2.x is built targeting .NET 2.0, I'm not sure how a Task
> return type would help us. Can you clarify?
>
> @everyone:
>
> Frankly, I'd rather hurry up with NUnit 3.0 than spend time on a
> half-a**ed fix of NUnit 2.6.
>
> --
> You received this bug notification because you are a bug assignee.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Richard Beier (rpbeier) wrote : | #13 |
I just came across this thread while searching for a way to run async tests with NUnit 2.6.
Stephen Cleary's workaround ("Right Way #1") seems to work fine for NUnit:
http://
This requires two classes which Stephen has included in his AsyncUnitTests-
http://
http://
This sample test correctly fails in the Resharper 7 NUnit runner:
http://
Thanks,
Richard
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #14 |
Thanks for the pointer... interesting articles.
Unfortunately, Stephen's code is licensed under MS-PL, making it incompatible
with either the NUnit 2.6 or NUnit 3.0 license. (I looked that up before linking
to the code and then didn't look at it to avoid any possibility of "stealing" it
by mistake.)
It's not clear to me how some folks choose licenses, but a lot of them are
using MS-PL these days, perhaps not realizing that code can't be used by
any open source projects except those that also use MS-PL.
Nevertheless, we'll get there anyway. :-)
Charlie
On Fri, Sep 28, 2012 at 3:54 PM, Richard Beier <email address hidden> wrote:
> I just came across this thread while searching for a way to run async
> tests with NUnit 2.6.
>
> Stephen Cleary's workaround ("Right Way #1") seems to work fine for NUnit:
> http://
>
> This requires two classes which Stephen has included in his AsyncUnitTests-
> http://
> http://
>
> This sample test correctly fails in the Resharper 7 NUnit runner:
> http://
>
> Thanks,
> Richard
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> To manage notifications about this bug go to:
> https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #15 |
Based on Simone's work, I added this back to the NUnitV2 project, targeting the 2.6.2 release.
Changed in nunitv2: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
assignee: | nobody → Simone Busoli (simone.busoli) |
milestone: | none → 2.6.2 |
status: | Triaged → In Progress |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #16 |
Since I am fairly free, I can work on this issue independently as a spike. Please point me to the appropriate files in NUnit v2.
I will be working on finding if the async threads' context can be independently established.
This will help in maintaining that tests "await"-ing a async result is testing the right context and will also help in establishing the "void" context.
Jv
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #17 |
Hi Jv,
You should coordinate with Simone on this, since he has the
bug assigned. OTOH, there are tons of things to do other
than this if you want something of your own!
Charlie
On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden> wrote:
> Since I am fairly free, I can work on this issue independently as a
> spike. Please point me to the appropriate files in NUnit v2.
>
> I will be working on finding if the async threads' context can be
> independently established.
>
> This will help in maintaining that tests "await"-ing a async result is
> testing the right context and will also help in establishing the "void"
> context.
>
> Jv
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> To manage notifications about this bug go to:
> https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #18 |
Sure, Charlie, but this particular problem does require more than one
person I thought and hence suggested to help. I will try to independently
simulate some similar async scenarios and then seek help on how it can be
merged with Simone's work.
Jv
On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden> wrote:
> Hi Jv,
>
> You should coordinate with Simone on this, since he has the
> bug assigned. OTOH, there are tons of things to do other
> than this if you want something of your own!
>
> Charlie
>
> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden> wrote:
> > Since I am fairly free, I can work on this issue independently as a
> > spike. Please point me to the appropriate files in NUnit v2.
> >
> > I will be working on finding if the async threads' context can be
> > independently established.
> >
> > This will help in maintaining that tests "await"-ing a async result is
> > testing the right context and will also help in establishing the "void"
> > context.
> >
> > Jv
> >
> > --
> > You received this bug notification because you are subscribed to NUnit
> > Extended Testing Platform.
> > https:/
> >
> > Title:
> > C#5 async tests are not supported
> >
> > To manage notifications about this bug go to:
> > https:/
>
> --
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
> Status in NUnit V2 Test Framework:
> In Progress
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
--
Regards,
Ravichandran Jv
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #19 |
Sounds good! One thing we need is a test assembly built in VS2012,
which contains all sorts of combinations of test features, for example,
test cases that use an async method, methods with timeout plus async,
methods using testcasesource, etc. The existing NUnit tests have lots
of examples but of course none of them can use async.
This is actually something that would help us implement async tests
in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
Charlie
On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> Sure, Charlie, but this particular problem does require more than one
> person I thought and hence suggested to help. I will try to independently
> simulate some similar async scenarios and then seek help on how it can be
> merged with Simone's work.
>
> Jv
>
> On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden> wrote:
>
>> Hi Jv,
>>
>> You should coordinate with Simone on this, since he has the
>> bug assigned. OTOH, there are tons of things to do other
>> than this if you want something of your own!
>>
>> Charlie
>>
>> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden> wrote:
>> > Since I am fairly free, I can work on this issue independently as a
>> > spike. Please point me to the appropriate files in NUnit v2.
>> >
>> > I will be working on finding if the async threads' context can be
>> > independently established.
>> >
>> > This will help in maintaining that tests "await"-ing a async result is
>> > testing the right context and will also help in establishing the "void"
>> > context.
>> >
>> > Jv
>> >
>> > --
>> > You received this bug notification because you are subscribed to NUnit
>> > Extended Testing Platform.
>> > https:/
>> >
>> > Title:
>> > C#5 async tests are not supported
>> >
>> > To manage notifications about this bug go to:
>> > https:/
>>
>> --
>> You received this bug notification because you are a member of NUnit
>> Developers, which is subscribed to NUnit V2.
>> https:/
>>
>> Title:
>> C#5 async tests are not supported
>>
>> Status in NUnit Test Framework:
>> Triaged
>> Status in NUnitLite Testing Framework:
>> Triaged
>> Status in NUnit V2 Test Framework:
>> In Progress
>>
>> Bug description:
>> If a method is marked async, nunit does not recognise it as a test,
>> and some test runners may incorrectly pass it while it is still
>> running. These methods actually return a Task not void, and the test
>> can only be passed if the task completes without a failure.
>>
>> As detailed here http://
>>
>> MSTest supports async tests
>>
>> http://
>>
>> To manage notifications about this bug go to:
>> https:/
>>
>
>
> --
> Regards,
>
> Ravichandran Jv
> http://
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #21 |
Hello, I've pushed the changes to the branch you see below and the
description of the merge request for details.
Charlie, I didn't take any decision with regards to how to handle solution
projects built for fx > 2.0 so in order to run the build you need to have
4.5 and specify net-4.0 as the target via nant (apparently it still doesn't
explicitly support .NET 4.5). I guess it would make sense to put some
conditionals in the build scripts, but it's a bit confusing, specifically
because this feature is available also for the net-2.0 build so it would
make sense to run its tests even in that case, but then I'm not sure how
you could build the test assembly if you have specified the net-2.0/3.5
targets, as the build will fail. Maybe an override specifically for that
project? I kept the changes in that regard to the minimum so you have have
a look at how it would make sense to handle it.
Simone
On Mon, Oct 1, 2012 at 2:27 AM, Launchpad Bug Tracker <
<email address hidden>> wrote:
> ** Branch linked: lp:~simone.busoli/nunitv2/async-support-void-and-task-
> return-types
>
> --
> You received this bug notification because you are a bug assignee.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
> Status in NUnit V2 Test Framework:
> In Progress
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #20 |
Hello, I've pushed the changes to a new branch, please have a look at the description of the merge request for details.
Charlie, I didn't take any decision with regards to how to handle solution projects built for fx > 2.0 so in order to run the build you need to have 4.5 and specify net-4.0 as the target via nant (apparently it still doesn't explicitly support .NET 4.5). I guess it would make sense to put some conditionals in the build scripts, but it's a bit confusing, specifically because this feature is available also for the net-2.0 build so it would make sense to run its tests even in that case, but then I'm not sure how you could build the test assembly if you have specified the net-2.0/3.5 targets, as the build will fail. Maybe an override specifically for that project? I kept the changes in that regard to the minimum so you have have a look at how it would make sense to handle it.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #22 |
Ok, will do.
I downloaded TFS 2012 express but my Windows Home Basic does not support it
so mid-way downloading VS 2012 express...will be able to deliver some
scenarios by this weekend.Unusual power failure in my area since morning
may not help my cause today, it seems.
Jv
On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
> Sounds good! One thing we need is a test assembly built in VS2012,
> which contains all sorts of combinations of test features, for example,
> test cases that use an async method, methods with timeout plus async,
> methods using testcasesource, etc. The existing NUnit tests have lots
> of examples but of course none of them can use async.
>
> This is actually something that would help us implement async tests
> in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
>
> Charlie
>
> On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> > Sure, Charlie, but this particular problem does require more than one
> > person I thought and hence suggested to help. I will try to independently
> > simulate some similar async scenarios and then seek help on how it can be
> > merged with Simone's work.
> >
> > Jv
> >
> > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden> wrote:
> >
> >> Hi Jv,
> >>
> >> You should coordinate with Simone on this, since he has the
> >> bug assigned. OTOH, there are tons of things to do other
> >> than this if you want something of your own!
> >>
> >> Charlie
> >>
> >> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden> wrote:
> >> > Since I am fairly free, I can work on this issue independently as a
> >> > spike. Please point me to the appropriate files in NUnit v2.
> >> >
> >> > I will be working on finding if the async threads' context can be
> >> > independently established.
> >> >
> >> > This will help in maintaining that tests "await"-ing a async result is
> >> > testing the right context and will also help in establishing the
> "void"
> >> > context.
> >> >
> >> > Jv
> >> >
> >> > --
> >> > You received this bug notification because you are subscribed to NUnit
> >> > Extended Testing Platform.
> >> > https:/
> >> >
> >> > Title:
> >> > C#5 async tests are not supported
> >> >
> >> > To manage notifications about this bug go to:
> >> > https:/
> >>
> >> --
> >> You received this bug notification because you are a member of NUnit
> >> Developers, which is subscribed to NUnit V2.
> >> https:/
> >>
> >> Title:
> >> C#5 async tests are not supported
> >>
> >> Status in NUnit Test Framework:
> >> Triaged
> >> Status in NUnitLite Testing Framework:
> >> Triaged
> >> Status in NUnit V2 Test Framework:
> >> In Progress
> >>
> >> Bug description:
> >> If a method is marked async, nunit does not recognise it as a test,
> >> and some test runners may incorrectly pass it while it is still
> >> running. These methods actually return a Task not void, and the test
> >> can only be passed if the task completes without a failure.
> >>
> >> As detailed here
> http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #23 |
Jv, I've committed the complete feature in this
branch<https:/
I would suggest you have it a look and come up with improvements
or additional test scenarios eventually. For instance I'm not 100%
confident of the implementation of the custom synchronization context, but
I didn't find any way to make any test fail yet.
Simone
On Mon, Oct 1, 2012 at 9:43 AM, Jv <email address hidden> wrote:
> Ok, will do.
>
> I downloaded TFS 2012 express but my Windows Home Basic does not support it
> so mid-way downloading VS 2012 express...will be able to deliver some
> scenarios by this weekend.Unusual power failure in my area since morning
> may not help my cause today, it seems.
>
> Jv
>
> On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
>
> > Sounds good! One thing we need is a test assembly built in VS2012,
> > which contains all sorts of combinations of test features, for example,
> > test cases that use an async method, methods with timeout plus async,
> > methods using testcasesource, etc. The existing NUnit tests have lots
> > of examples but of course none of them can use async.
> >
> > This is actually something that would help us implement async tests
> > in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
> >
> > Charlie
> >
> > On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> > > Sure, Charlie, but this particular problem does require more than one
> > > person I thought and hence suggested to help. I will try to
> independently
> > > simulate some similar async scenarios and then seek help on how it can
> be
> > > merged with Simone's work.
> > >
> > > Jv
> > >
> > > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden>
> wrote:
> > >
> > >> Hi Jv,
> > >>
> > >> You should coordinate with Simone on this, since he has the
> > >> bug assigned. OTOH, there are tons of things to do other
> > >> than this if you want something of your own!
> > >>
> > >> Charlie
> > >>
> > >> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden>
> wrote:
> > >> > Since I am fairly free, I can work on this issue independently as a
> > >> > spike. Please point me to the appropriate files in NUnit v2.
> > >> >
> > >> > I will be working on finding if the async threads' context can be
> > >> > independently established.
> > >> >
> > >> > This will help in maintaining that tests "await"-ing a async result
> is
> > >> > testing the right context and will also help in establishing the
> > "void"
> > >> > context.
> > >> >
> > >> > Jv
> > >> >
> > >> > --
> > >> > You received this bug notification because you are subscribed to
> NUnit
> > >> > Extended Testing Platform.
> > >> > https:/
> > >> >
> > >> > Title:
> > >> > C#5 async tests are not supported
> > >> >
> > >> > To manage notifications about this bug go to:
> > >> > https:/
> > >>
> > >> --
> > >> You received this bug notification because you are a member of NUnit
> > >> Developers, which is subscribed to NUnit V2.
> > >> https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Anthony Steele (anthony-steele) wrote : | #24 |
@Charlie: You're right, task return type only helps if you are targeting .Net 4.0 or up.
I see you guys have goten quite far with this already. :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #25 |
Hi Anthony, yes, if you have had any experience with implementing I'd
appreciate if you could have a look at the branch where I've implemented
it. A nice addition is that it would also now be possible to do this:
[TestCase(Result = 1)]
public async Task<int> Do()
{
return await Task.FromResult(1);
}
On Mon, Oct 1, 2012 at 11:28 AM, Anthony Steele <Anthony.
> wrote:
> @Charlie: You're right, task return type only helps if you are targeting
> .Net 4.0 or up.
>
> I see you guys have goten quite far with this already. :)
>
> --
> You received this bug notification because you are a bug assignee.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
> Status in NUnit V2 Test Framework:
> In Progress
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #26 |
Thanks, Simone, will do.
Jv
On Mon, Oct 1, 2012 at 2:16 PM, Simone Busoli <email address hidden>wrote:
> Jv, I've committed the complete feature in this
> branch<
> https:/
> >already,
> I would suggest you have it a look and come up with improvements
> or additional test scenarios eventually. For instance I'm not 100%
> confident of the implementation of the custom synchronization context, but
> I didn't find any way to make any test fail yet.
>
> Simone
>
> On Mon, Oct 1, 2012 at 9:43 AM, Jv <email address hidden> wrote:
>
> > Ok, will do.
> >
> > I downloaded TFS 2012 express but my Windows Home Basic does not support
> it
> > so mid-way downloading VS 2012 express...will be able to deliver some
> > scenarios by this weekend.Unusual power failure in my area since morning
> > may not help my cause today, it seems.
> >
> > Jv
> >
> > On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
> >
> > > Sounds good! One thing we need is a test assembly built in VS2012,
> > > which contains all sorts of combinations of test features, for example,
> > > test cases that use an async method, methods with timeout plus async,
> > > methods using testcasesource, etc. The existing NUnit tests have lots
> > > of examples but of course none of them can use async.
> > >
> > > This is actually something that would help us implement async tests
> > > in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
> > >
> > > Charlie
> > >
> > > On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> > > > Sure, Charlie, but this particular problem does require more than one
> > > > person I thought and hence suggested to help. I will try to
> > independently
> > > > simulate some similar async scenarios and then seek help on how it
> can
> > be
> > > > merged with Simone's work.
> > > >
> > > > Jv
> > > >
> > > > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden>
> > wrote:
> > > >
> > > >> Hi Jv,
> > > >>
> > > >> You should coordinate with Simone on this, since he has the
> > > >> bug assigned. OTOH, there are tons of things to do other
> > > >> than this if you want something of your own!
> > > >>
> > > >> Charlie
> > > >>
> > > >> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden>
> > wrote:
> > > >> > Since I am fairly free, I can work on this issue independently as
> a
> > > >> > spike. Please point me to the appropriate files in NUnit v2.
> > > >> >
> > > >> > I will be working on finding if the async threads' context can be
> > > >> > independently established.
> > > >> >
> > > >> > This will help in maintaining that tests "await"-ing a async
> result
> > is
> > > >> > testing the right context and will also help in establishing the
> > > "void"
> > > >> > context.
> > > >> >
> > > >> > Jv
> > > >> >
> > > >> > --
> > > >> > You received this bug notification because you are subscribed to
> > NUnit
> > > >> > Extended Testing Platform.
> > > >> > https:/
> > > >> >
> > > >> > Title:
> > > >> > C#5 async tests are not supported
> > > >> >
> > > >> > To manage notific...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #27 |
Hi Charlie,
1. Will start with the scenarios outlined by you plus some of my own. Maybe
they could feature in the help section.
2. Waiting for the merge to happen or can NUnit GUI work with Simone's
commit?
Because I also want to test the GCConcurrent (for previous .net versions)
and serverGc (for .net 4.5) element and this can be done only through the
App config file. I guess this is more important due to it being the new
feature in .Net 4.5.
3. The unmanaged aspect to it, where the above configuration settings can
be overridden by the requesting app.What happens in the test (this is not a
question) when the config settings can be overridden by a call to
IsServerGC call from the unmanaged app. Is this consideration important?
And to complicate things further, some processor.
supported.
I am not sure if this should be documented as a known issue in NUnit or
should NUnit provide a hint when the Async tests are run or executed?
4. The Synchronization
tricky when GcCocurrent and ServerGC elements can both be used. Please
comment on this with reference to #2 above.
Jv
On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
> Sounds good! One thing we need is a test assembly built in VS2012,
> which contains all sorts of combinations of test features, for example,
> test cases that use an async method, methods with timeout plus async,
> methods using testcasesource, etc. The existing NUnit tests have lots
> of examples but of course none of them can use async.
>
> This is actually something that would help us implement async tests
> in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
>
> Charlie
>
> On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> > Sure, Charlie, but this particular problem does require more than one
> > person I thought and hence suggested to help. I will try to independently
> > simulate some similar async scenarios and then seek help on how it can be
> > merged with Simone's work.
> >
> > Jv
> >
> > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden> wrote:
> >
> >> Hi Jv,
> >>
> >> You should coordinate with Simone on this, since he has the
> >> bug assigned. OTOH, there are tons of things to do other
> >> than this if you want something of your own!
> >>
> >> Charlie
> >>
> >> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden> wrote:
> >> > Since I am fairly free, I can work on this issue independently as a
> >> > spike. Please point me to the appropriate files in NUnit v2.
> >> >
> >> > I will be working on finding if the async threads' context can be
> >> > independently established.
> >> >
> >> > This will help in maintaining that tests "await"-ing a async result is
> >> > testing the right context and will also help in establishing the
> "void"
> >> > context.
> >> >
> >> > Jv
> >> >
> >> > --
> >> > You received this bug notification because you are subscribed to NUnit
> >> > Extended Testing Platform.
> >> > https:/
> >> >
> >> > Title:
> >> > C#5 async tests are not supported
> >> >
> >> > To manage notifications about this bug ...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #28 |
For anyone who would like to try it out and improve the test coverage these
are the steps:
1. bzr branch
lp:~simone.busoli/nunitv2/async-support-void-and-task-return-types
2. cd into the directory
3. [optional] modify the NUnitTests.v2.nunit to contain only the 4.5
core test assembly
4. build.bat test net-4.0
Of course existing runners/core cannot run the new tests, so they have to
be built from the source, which is what the above steps do.
I'd say that GC modes have nothing to do with this though.
Simone
On Tue, Oct 2, 2012 at 4:56 PM, Jv <email address hidden> wrote:
> Hi Charlie,
>
> 1. Will start with the scenarios outlined by you plus some of my own. Maybe
> they could feature in the help section.
>
> 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
> commit?
>
> Because I also want to test the GCConcurrent (for previous .net versions)
> and serverGc (for .net 4.5) element and this can be done only through the
> App config file. I guess this is more important due to it being the new
> feature in .Net 4.5.
>
> 3. The unmanaged aspect to it, where the above configuration settings can
> be overridden by the requesting app.What happens in the test (this is not a
> question) when the config settings can be overridden by a call to
> IsServerGC call from the unmanaged app. Is this consideration important?
> And to complicate things further, some processor.
> supported.
>
> I am not sure if this should be documented as a known issue in NUnit or
> should NUnit provide a hint when the Async tests are run or executed?
>
> 4. The Synchronization
> tricky when GcCocurrent and ServerGC elements can both be used. Please
> comment on this with reference to #2 above.
>
> Jv
>
> On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
>
> > Sounds good! One thing we need is a test assembly built in VS2012,
> > which contains all sorts of combinations of test features, for example,
> > test cases that use an async method, methods with timeout plus async,
> > methods using testcasesource, etc. The existing NUnit tests have lots
> > of examples but of course none of them can use async.
> >
> > This is actually something that would help us implement async tests
> > in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
> >
> > Charlie
> >
> > On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> > > Sure, Charlie, but this particular problem does require more than one
> > > person I thought and hence suggested to help. I will try to
> independently
> > > simulate some similar async scenarios and then seek help on how it can
> be
> > > merged with Simone's work.
> > >
> > > Jv
> > >
> > > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden>
> wrote:
> > >
> > >> Hi Jv,
> > >>
> > >> You should coordinate with Simone on this, since he has the
> > >> bug assigned. OTOH, there are tons of things to do other
> > >> than this if you want something of your own!
> > >>
> > >> Charlie
> > >>
> > >> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden>
> wrote:
> > >> > Since I am fair...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : Re: [Nunit-core] [Bug 1057981] Re: C#5 async tests are not supported | #29 |
Hi Jv,
You have to pull and build Simone's branch from source in order to be
able to work on this at all. As I remember from some previous work
you did, you were unable to do that on your machine. Is that still
a problem for you?
Charlie
On Tue, Oct 2, 2012 at 7:56 AM, Jv <email address hidden> wrote:
> Hi Charlie,
>
> 1. Will start with the scenarios outlined by you plus some of my own. Maybe
> they could feature in the help section.
>
> 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
> commit?
>
> Because I also want to test the GCConcurrent (for previous .net versions)
> and serverGc (for .net 4.5) element and this can be done only through the
> App config file. I guess this is more important due to it being the new
> feature in .Net 4.5.
>
> 3. The unmanaged aspect to it, where the above configuration settings can
> be overridden by the requesting app.What happens in the test (this is not a
> question) when the config settings can be overridden by a call to
> IsServerGC call from the unmanaged app. Is this consideration important?
> And to complicate things further, some processor.
> supported.
>
> I am not sure if this should be documented as a known issue in NUnit or
> should NUnit provide a hint when the Async tests are run or executed?
>
> 4. The Synchronization
> tricky when GcCocurrent and ServerGC elements can both be used. Please
> comment on this with reference to #2 above.
>
> Jv
>
> On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
>
>> Sounds good! One thing we need is a test assembly built in VS2012,
>> which contains all sorts of combinations of test features, for example,
>> test cases that use an async method, methods with timeout plus async,
>> methods using testcasesource, etc. The existing NUnit tests have lots
>> of examples but of course none of them can use async.
>>
>> This is actually something that would help us implement async tests
>> in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
>>
>> Charlie
>>
>> On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
>> > Sure, Charlie, but this particular problem does require more than one
>> > person I thought and hence suggested to help. I will try to independently
>> > simulate some similar async scenarios and then seek help on how it can be
>> > merged with Simone's work.
>> >
>> > Jv
>> >
>> > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden> wrote:
>> >
>> >> Hi Jv,
>> >>
>> >> You should coordinate with Simone on this, since he has the
>> >> bug assigned. OTOH, there are tons of things to do other
>> >> than this if you want something of your own!
>> >>
>> >> Charlie
>> >>
>> >> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden> wrote:
>> >> > Since I am fairly free, I can work on this issue independently as a
>> >> > spike. Please point me to the appropriate files in NUnit v2.
>> >> >
>> >> > I will be working on finding if the async threads' context can be
>> >> > independently established.
>> >> >
>> >> > This will help in maintaining that tests "await"-ing a async result is
>> >> ...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #31 |
Hi Charlie,
No problems. Branched Simone's three times for different reasons/tests. All
builds succeed. Building with VS 2012 Express edition for Windows Desktop
since it will be required by you later, I guess.
I am working on the await scenarios, in an independent project file, but
with the .core dlls built of Simone's branch.
My contribution, here, I guess will be to provide you with help examples
for the wiki and if something comes up related to the tests, will post it
here!
A question though. Is it necessary for the Test method to be marked Async?
Since await returns a Task, can there be a scenario for the NUnit test
method to not be Async ?
Thanks,
Jv
On Tue, Oct 2, 2012 at 9:40 PM, Charlie Poole <email address hidden> wrote:
> Hi Jv,
>
> You have to pull and build Simone's branch from source in order to be
> able to work on this at all. As I remember from some previous work
> you did, you were unable to do that on your machine. Is that still
> a problem for you?
>
> Charlie
>
> On Tue, Oct 2, 2012 at 7:56 AM, Jv <email address hidden> wrote:
> > Hi Charlie,
> >
> > 1. Will start with the scenarios outlined by you plus some of my own.
> Maybe
> > they could feature in the help section.
> >
> > 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
> > commit?
> >
> > Because I also want to test the GCConcurrent (for previous .net versions)
> > and serverGc (for .net 4.5) element and this can be done only through the
> > App config file. I guess this is more important due to it being the new
> > feature in .Net 4.5.
> >
> > 3. The unmanaged aspect to it, where the above configuration settings can
> > be overridden by the requesting app.What happens in the test (this is
> not a
> > question) when the config settings can be overridden by a call to
> > IsServerGC call from the unmanaged app. Is this consideration important?
> > And to complicate things further, some processor.
> > supported.
> >
> > I am not sure if this should be documented as a known issue in NUnit or
> > should NUnit provide a hint when the Async tests are run or executed?
> >
> > 4. The Synchronization
> quite
> > tricky when GcCocurrent and ServerGC elements can both be used. Please
> > comment on this with reference to #2 above.
> >
> > Jv
> >
> > On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
> >
> >> Sounds good! One thing we need is a test assembly built in VS2012,
> >> which contains all sorts of combinations of test features, for example,
> >> test cases that use an async method, methods with timeout plus async,
> >> methods using testcasesource, etc. The existing NUnit tests have lots
> >> of examples but of course none of them can use async.
> >>
> >> This is actually something that would help us implement async tests
> >> in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
> >>
> >> Charlie
> >>
> >> On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> >> > Sure, Charlie, but this particular problem does require more than one
> >> > person I thought and hence suggested to help. I will try to
> independently
> >> > s...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #30 |
Is not the branch pull-ed by me not visible in the lp log?
Jv
On Tue, Oct 2, 2012 at 9:40 PM, Charlie Poole <email address hidden> wrote:
> Hi Jv,
>
> You have to pull and build Simone's branch from source in order to be
> able to work on this at all. As I remember from some previous work
> you did, you were unable to do that on your machine. Is that still
> a problem for you?
>
> Charlie
>
> On Tue, Oct 2, 2012 at 7:56 AM, Jv <email address hidden> wrote:
> > Hi Charlie,
> >
> > 1. Will start with the scenarios outlined by you plus some of my own.
> Maybe
> > they could feature in the help section.
> >
> > 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
> > commit?
> >
> > Because I also want to test the GCConcurrent (for previous .net versions)
> > and serverGc (for .net 4.5) element and this can be done only through the
> > App config file. I guess this is more important due to it being the new
> > feature in .Net 4.5.
> >
> > 3. The unmanaged aspect to it, where the above configuration settings can
> > be overridden by the requesting app.What happens in the test (this is
> not a
> > question) when the config settings can be overridden by a call to
> > IsServerGC call from the unmanaged app. Is this consideration important?
> > And to complicate things further, some processor.
> > supported.
> >
> > I am not sure if this should be documented as a known issue in NUnit or
> > should NUnit provide a hint when the Async tests are run or executed?
> >
> > 4. The Synchronization
> quite
> > tricky when GcCocurrent and ServerGC elements can both be used. Please
> > comment on this with reference to #2 above.
> >
> > Jv
> >
> > On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
> >
> >> Sounds good! One thing we need is a test assembly built in VS2012,
> >> which contains all sorts of combinations of test features, for example,
> >> test cases that use an async method, methods with timeout plus async,
> >> methods using testcasesource, etc. The existing NUnit tests have lots
> >> of examples but of course none of them can use async.
> >>
> >> This is actually something that would help us implement async tests
> >> in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
> >>
> >> Charlie
> >>
> >> On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
> >> > Sure, Charlie, but this particular problem does require more than one
> >> > person I thought and hence suggested to help. I will try to
> independently
> >> > simulate some similar async scenarios and then seek help on how it
> can be
> >> > merged with Simone's work.
> >> >
> >> > Jv
> >> >
> >> > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden>
> wrote:
> >> >
> >> >> Hi Jv,
> >> >>
> >> >> You should coordinate with Simone on this, since he has the
> >> >> bug assigned. OTOH, there are tons of things to do other
> >> >> than this if you want something of your own!
> >> >>
> >> >> Charlie
> >> >>
> >> >> On Sun, Sep 30, 2012 at 4:02 AM, Jv <email address hidden>
> wrote:
> >> >> > Since I am fairly free, I can work on this issue indep...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #32 |
That's a scary idea. Anybody can see what you are accessing? No,
not as far as I know. :-) Perhaps the LP guys can.
Charlie
On Tue, Oct 2, 2012 at 9:56 AM, Jv <email address hidden> wrote:
> Is not the branch pull-ed by me not visible in the lp log?
>
> Jv
>
> On Tue, Oct 2, 2012 at 9:40 PM, Charlie Poole <email address hidden> wrote:
>
>> Hi Jv,
>>
>> You have to pull and build Simone's branch from source in order to be
>> able to work on this at all. As I remember from some previous work
>> you did, you were unable to do that on your machine. Is that still
>> a problem for you?
>>
>> Charlie
>>
>> On Tue, Oct 2, 2012 at 7:56 AM, Jv <email address hidden> wrote:
>> > Hi Charlie,
>> >
>> > 1. Will start with the scenarios outlined by you plus some of my own.
>> Maybe
>> > they could feature in the help section.
>> >
>> > 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
>> > commit?
>> >
>> > Because I also want to test the GCConcurrent (for previous .net versions)
>> > and serverGc (for .net 4.5) element and this can be done only through the
>> > App config file. I guess this is more important due to it being the new
>> > feature in .Net 4.5.
>> >
>> > 3. The unmanaged aspect to it, where the above configuration settings can
>> > be overridden by the requesting app.What happens in the test (this is
>> not a
>> > question) when the config settings can be overridden by a call to
>> > IsServerGC call from the unmanaged app. Is this consideration important?
>> > And to complicate things further, some processor.
>> > supported.
>> >
>> > I am not sure if this should be documented as a known issue in NUnit or
>> > should NUnit provide a hint when the Async tests are run or executed?
>> >
>> > 4. The Synchronization
>> quite
>> > tricky when GcCocurrent and ServerGC elements can both be used. Please
>> > comment on this with reference to #2 above.
>> >
>> > Jv
>> >
>> > On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
>> >
>> >> Sounds good! One thing we need is a test assembly built in VS2012,
>> >> which contains all sorts of combinations of test features, for example,
>> >> test cases that use an async method, methods with timeout plus async,
>> >> methods using testcasesource, etc. The existing NUnit tests have lots
>> >> of examples but of course none of them can use async.
>> >>
>> >> This is actually something that would help us implement async tests
>> >> in all three projects... NUnit V2, NUnit 3.0 and NUnitLite
>> >>
>> >> Charlie
>> >>
>> >> On Sun, Sep 30, 2012 at 2:39 PM, Jv <email address hidden> wrote:
>> >> > Sure, Charlie, but this particular problem does require more than one
>> >> > person I thought and hence suggested to help. I will try to
>> independently
>> >> > simulate some similar async scenarios and then seek help on how it
>> can be
>> >> > merged with Simone's work.
>> >> >
>> >> > Jv
>> >> >
>> >> > On Mon, Oct 1, 2012 at 2:45 AM, Charlie Poole <email address hidden>
>> wrote:
>> >> >
>> >> >> Hi Jv,
>> >> >>
>> >> >> You should coordinate with Simone on this, since he has the
>> >> >> bug assign...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #33 |
Hi Jv,
On Tue, Oct 2, 2012 at 9:54 AM, Jv <email address hidden> wrote:
> Hi Charlie,
>
> No problems. Branched Simone's three times for different reasons/tests. All
> builds succeed. Building with VS 2012 Express edition for Windows Desktop
> since it will be required by you later, I guess.
No, that won't be required and won't even work I'm afraid.
First, NUnit V2 will never be built for .NET 4.5. That's what 3.0 is for.
Second, what we are trying to test here is whether NUnit V2, built for
.NET 2.0, can run tests built for .NET 4.5, which use async. Simone has
used reflection to do it and has not used any 4.5 features.
Of course, to test this, we need Tests built for .NET 4.5 but NUnit has
to be built as normally. Will the Express edition allow targeting .NET 2.0
when you build NUnit?
Charlie
> I am working on the await scenarios, in an independent project file, but
> with the .core dlls built of Simone's branch.
>
> My contribution, here, I guess will be to provide you with help examples
> for the wiki and if something comes up related to the tests, will post it
> here!
>
> A question though. Is it necessary for the Test method to be marked Async?
> Since await returns a Task, can there be a scenario for the NUnit test
> method to not be Async ?
>
> Thanks,
>
> Jv
>
> On Tue, Oct 2, 2012 at 9:40 PM, Charlie Poole <email address hidden> wrote:
>
>> Hi Jv,
>>
>> You have to pull and build Simone's branch from source in order to be
>> able to work on this at all. As I remember from some previous work
>> you did, you were unable to do that on your machine. Is that still
>> a problem for you?
>>
>> Charlie
>>
>> On Tue, Oct 2, 2012 at 7:56 AM, Jv <email address hidden> wrote:
>> > Hi Charlie,
>> >
>> > 1. Will start with the scenarios outlined by you plus some of my own.
>> Maybe
>> > they could feature in the help section.
>> >
>> > 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
>> > commit?
>> >
>> > Because I also want to test the GCConcurrent (for previous .net versions)
>> > and serverGc (for .net 4.5) element and this can be done only through the
>> > App config file. I guess this is more important due to it being the new
>> > feature in .Net 4.5.
>> >
>> > 3. The unmanaged aspect to it, where the above configuration settings can
>> > be overridden by the requesting app.What happens in the test (this is
>> not a
>> > question) when the config settings can be overridden by a call to
>> > IsServerGC call from the unmanaged app. Is this consideration important?
>> > And to complicate things further, some processor.
>> > supported.
>> >
>> > I am not sure if this should be documented as a known issue in NUnit or
>> > should NUnit provide a hint when the Async tests are run or executed?
>> >
>> > 4. The Synchronization
>> quite
>> > tricky when GcCocurrent and ServerGC elements can both be used. Please
>> > comment on this with reference to #2 above.
>> >
>> > Jv
>> >
>> > On Mon, Oct 1, 2012 at 3:37 AM, Charlie Poole <email address hidden> wrote:
>> >
>> >> Sounds good! One thing we need is a test assembly built in VS2012,
>> >> which contai...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #34 |
- targetframeworks.png Edit (127.1 KiB, image/png; name="targetframeworks.png")
Yes, it does, attached is the project properties page but the Express
distribution says it is meant for evaluation purposes only. I do not know
what help it can be from your perspective.
Yes, but the Reflection class (in nunit.core.
LinqExpressions. Will this not pose a problem if the target framework is
2.0? Sorry if this is a stupid question.
Jv
On Tue, Oct 2, 2012 at 11:23 PM, Charlie Poole <email address hidden> wrote:
> Hi Jv,
>
> On Tue, Oct 2, 2012 at 9:54 AM, Jv <email address hidden> wrote:
> > Hi Charlie,
> >
> > No problems. Branched Simone's three times for different reasons/tests.
> All
> > builds succeed. Building with VS 2012 Express edition for Windows Desktop
> > since it will be required by you later, I guess.
>
> No, that won't be required and won't even work I'm afraid.
>
> First, NUnit V2 will never be built for .NET 4.5. That's what 3.0 is
> for.
>
> Second, what we are trying to test here is whether NUnit V2, built for
> .NET 2.0, can run tests built for .NET 4.5, which use async. Simone has
> used reflection to do it and has not used any 4.5 features.
>
> Of course, to test this, we need Tests built for .NET 4.5 but NUnit has
> to be built as normally. Will the Express edition allow targeting .NET 2.0
> when you build NUnit?
>
> Charlie
>
> > I am working on the await scenarios, in an independent project file, but
> > with the .core dlls built of Simone's branch.
> >
> > My contribution, here, I guess will be to provide you with help examples
> > for the wiki and if something comes up related to the tests, will post it
> > here!
> >
> > A question though. Is it necessary for the Test method to be marked
> Async?
> > Since await returns a Task, can there be a scenario for the NUnit test
> > method to not be Async ?
> >
> > Thanks,
> >
> > Jv
> >
> > On Tue, Oct 2, 2012 at 9:40 PM, Charlie Poole <email address hidden> wrote:
> >
> >> Hi Jv,
> >>
> >> You have to pull and build Simone's branch from source in order to be
> >> able to work on this at all. As I remember from some previous work
> >> you did, you were unable to do that on your machine. Is that still
> >> a problem for you?
> >>
> >> Charlie
> >>
> >> On Tue, Oct 2, 2012 at 7:56 AM, Jv <email address hidden> wrote:
> >> > Hi Charlie,
> >> >
> >> > 1. Will start with the scenarios outlined by you plus some of my own.
> >> Maybe
> >> > they could feature in the help section.
> >> >
> >> > 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
> >> > commit?
> >> >
> >> > Because I also want to test the GCConcurrent (for previous .net
> versions)
> >> > and serverGc (for .net 4.5) element and this can be done only through
> the
> >> > App config file. I guess this is more important due to it being the
> new
> >> > feature in .Net 4.5.
> >> >
> >> > 3. The unmanaged aspect to it, where the above configuration settings
> can
> >> > be overridden by the requesting app.What happens in the test (this is
> >> not a
> >> > question) when the config settings can be overridden by a call to
> >> > IsServerGC call from the unmanaged app. Is this consideration
> important?
> >> > And to complicate things further, some processor.archit...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #35 |
OK then, so you're safe. I know that their are various express releases and
some of them are limited in what they support.
I haven't loaded and tested that code yet. But the net45 test program is
just a set of tests, not NUnit. It is of course built for .NET 4.5. Simone
is working on making sure it will run under NUnit so it may not yet be
complete. Note that some code in nunit.core.tests is under the control
of #if statements, which keep it from being compiled when not wanted.
Charlie
On Tue, Oct 2, 2012 at 12:03 PM, Jv <email address hidden> wrote:
> Yes, it does, attached is the project properties page but the Express
> distribution says it is meant for evaluation purposes only. I do not know
> what help it can be from your perspective.
>
> Yes, but the Reflection class (in nunit.core.
> LinqExpressions. Will this not pose a problem if the target framework is
> 2.0? Sorry if this is a stupid question.
>
> Jv
>
> On Tue, Oct 2, 2012 at 11:23 PM, Charlie Poole <email address hidden>
> wrote:
>
>> Hi Jv,
>>
>> On Tue, Oct 2, 2012 at 9:54 AM, Jv <email address hidden> wrote:
>> > Hi Charlie,
>> >
>> > No problems. Branched Simone's three times for different reasons/tests.
>> All
>> > builds succeed. Building with VS 2012 Express edition for Windows Desktop
>> > since it will be required by you later, I guess.
>>
>> No, that won't be required and won't even work I'm afraid.
>>
>> First, NUnit V2 will never be built for .NET 4.5. That's what 3.0 is
>> for.
>>
>> Second, what we are trying to test here is whether NUnit V2, built for
>> .NET 2.0, can run tests built for .NET 4.5, which use async. Simone has
>> used reflection to do it and has not used any 4.5 features.
>>
>> Of course, to test this, we need Tests built for .NET 4.5 but NUnit has
>> to be built as normally. Will the Express edition allow targeting .NET 2.0
>> when you build NUnit?
>>
>> Charlie
>>
>> > I am working on the await scenarios, in an independent project file, but
>> > with the .core dlls built of Simone's branch.
>> >
>> > My contribution, here, I guess will be to provide you with help examples
>> > for the wiki and if something comes up related to the tests, will post it
>> > here!
>> >
>> > A question though. Is it necessary for the Test method to be marked
>> Async?
>> > Since await returns a Task, can there be a scenario for the NUnit test
>> > method to not be Async ?
>> >
>> > Thanks,
>> >
>> > Jv
>> >
>> > On Tue, Oct 2, 2012 at 9:40 PM, Charlie Poole <email address hidden> wrote:
>> >
>> >> Hi Jv,
>> >>
>> >> You have to pull and build Simone's branch from source in order to be
>> >> able to work on this at all. As I remember from some previous work
>> >> you did, you were unable to do that on your machine. Is that still
>> >> a problem for you?
>> >>
>> >> Charlie
>> >>
>> >> On Tue, Oct 2, 2012 at 7:56 AM, Jv <email address hidden> wrote:
>> >> > Hi Charlie,
>> >> >
>> >> > 1. Will start with the scenarios outlined by you plus some of my own.
>> >> Maybe
>> >> > they could feature in the help section.
>> >> >
>> >> > 2. Waiting for the merge to happen or can NUnit GUI work with Simone's
>> >> > commit?
>> >> >
>> >> > Because I also...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #36 |
To summarize, the async feature works under NUnit built for CLR 2, of
course it will use an agent to run tests built for CLR > 2.
There is a sort of infrastructure problem that I posed already which
concerns how to build and test the async thing. Currently I didn't make any
explicit choice and the build fails if you try to build for CLR < 4,
because it tries to build the .NET 4.5 test assembly.
So far therefore you can successfully run a build with net-4.0, which will
run the new tests as well. Of course I also ran them under NUnit built for
CLR 2 but it's a manual process: exclude the tests from the build, build
for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly previously
built.
Ideally we would have to come up with a way to say that even when we build
for < 4.5 (there's no 4.5 now but only 4.0 as NAnt doesn't support it yet),
that assembly is still built for 4.5 so that tests can be run on it with
NUnit built for .NET < 4.5. I hope it makes sense. I would like to clarify
this with Charlie.
Also one question for Charlie: in order to see if tests are run correctly I
created some fixtures which are not supposed to be run directly but via my
own test code. In order to accomplish that I marked the suite as ignored,
but those tests then end up in the build results as ignored, which is not
really the case 'cause I'm running them by some other means. I wanted to
figure out if there was a way to make NUnit /ignore/ those tests so that
they don't show up as ignored.
Simone
On Tue, Oct 2, 2012 at 9:34 PM, Charlie Poole <email address hidden> wrote:
> OK then, so you're safe. I know that their are various express releases and
> some of them are limited in what they support.
>
> I haven't loaded and tested that code yet. But the net45 test program is
> just a set of tests, not NUnit. It is of course built for .NET 4.5. Simone
> is working on making sure it will run under NUnit so it may not yet be
> complete. Note that some code in nunit.core.tests is under the control
> of #if statements, which keep it from being compiled when not wanted.
>
> Charlie
>
> On Tue, Oct 2, 2012 at 12:03 PM, Jv <email address hidden> wrote:
> > Yes, it does, attached is the project properties page but the Express
> > distribution says it is meant for evaluation purposes only. I do not know
> > what help it can be from your perspective.
> >
> > Yes, but the Reflection class (in nunit.core.
> > LinqExpressions. Will this not pose a problem if the target framework is
> > 2.0? Sorry if this is a stupid question.
> >
> > Jv
> >
> > On Tue, Oct 2, 2012 at 11:23 PM, Charlie Poole <email address hidden>
> > wrote:
> >
> >> Hi Jv,
> >>
> >> On Tue, Oct 2, 2012 at 9:54 AM, Jv <email address hidden> wrote:
> >> > Hi Charlie,
> >> >
> >> > No problems. Branched Simone's three times for different
> reasons/tests.
> >> All
> >> > builds succeed. Building with VS 2012 Express edition for Windows
> Desktop
> >> > since it will be required by you later, I guess.
> >>
> >> No, that won't be required and won't even work I'm afraid.
> >>
> >> First, NUnit V2 will never be built for .NET 4.5. That's what 3.0 is
> >> for.
> >>
> >> Second, what we are tr...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #37 |
On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
<email address hidden> wrote:
> To summarize, the async feature works under NUnit built for CLR 2, of
> course it will use an agent to run tests built for CLR > 2.
>
> There is a sort of infrastructure problem that I posed already which
> concerns how to build and test the async thing. Currently I didn't make any
> explicit choice and the build fails if you try to build for CLR < 4,
> because it tries to build the .NET 4.5 test assembly.
> So far therefore you can successfully run a build with net-4.0, which will
> run the new tests as well. Of course I also ran them under NUnit built for
> CLR 2 but it's a manual process: exclude the tests from the build, build
> for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly previously
> built.
Yes, that's the infrastructure change I was hoping to avoid by postponing to
NUnit 3.0. :-) But never mind... you convinced me.
> Ideally we would have to come up with a way to say that even when we build
> for < 4.5 (there's no 4.5 now but only 4.0 as NAnt doesn't support it yet),
> that assembly is still built for 4.5 so that tests can be run on it with
> NUnit built for .NET < 4.5. I hope it makes sense. I would like to clarify
> this with Charlie.
What we need is a .NET 4.5 config. This guy has one...
http://
> Also one question for Charlie: in order to see if tests are run correctly I
> created some fixtures which are not supposed to be run directly but via my
> own test code. In order to accomplish that I marked the suite as ignored,
> but those tests then end up in the build results as ignored, which is not
> really the case 'cause I'm running them by some other means. I wanted to
> figure out if there was a way to make NUnit /ignore/ those tests so that
> they don't show up as ignored.
Put those tests in the test-assembly dll. That's what it's for. To see how
it's used by other tests, just pick any class there and find references.
Charlie
> Simone
>
>
> On Tue, Oct 2, 2012 at 9:34 PM, Charlie Poole <email address hidden> wrote:
>
>> OK then, so you're safe. I know that their are various express releases and
>> some of them are limited in what they support.
>>
>> I haven't loaded and tested that code yet. But the net45 test program is
>> just a set of tests, not NUnit. It is of course built for .NET 4.5. Simone
>> is working on making sure it will run under NUnit so it may not yet be
>> complete. Note that some code in nunit.core.tests is under the control
>> of #if statements, which keep it from being compiled when not wanted.
>>
>> Charlie
>>
>> On Tue, Oct 2, 2012 at 12:03 PM, Jv <email address hidden> wrote:
>> > Yes, it does, attached is the project properties page but the Express
>> > distribution says it is meant for evaluation purposes only. I do not know
>> > what help it can be from your perspective.
>> >
>> > Yes, but the Reflection class (in nunit.core.
>> > LinqExpressions. Will this not pose a problem if the target framework is
>> > 2.0? Sorry if this is a stupid question.
>> >
>> > Jv
>> >
>> > On Tue, Oct 2, 2012 at 11:23 PM, Char...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : | #38 |
inline
On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden> wrote:
> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
> <email address hidden> wrote:
> > To summarize, the async feature works under NUnit built for CLR 2, of
> > course it will use an agent to run tests built for CLR > 2.
> >
> > There is a sort of infrastructure problem that I posed already which
> > concerns how to build and test the async thing. Currently I didn't make
> any
> > explicit choice and the build fails if you try to build for CLR < 4,
> > because it tries to build the .NET 4.5 test assembly.
> > So far therefore you can successfully run a build with net-4.0, which
> will
> > run the new tests as well. Of course I also ran them under NUnit built
> for
> > CLR 2 but it's a manual process: exclude the tests from the build, build
> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
> previously
> > built.
>
> Yes, that's the infrastructure change I was hoping to avoid by postponing
> to
> NUnit 3.0. :-) But never mind... you convinced me.
>
So you'll take care of that, right? :) Or just share how you would do it
and I'll do the rest.
>
> > Ideally we would have to come up with a way to say that even when we
> build
> > for < 4.5 (there's no 4.5 now but only 4.0 as NAnt doesn't support it
> yet),
> > that assembly is still built for 4.5 so that tests can be run on it with
> > NUnit built for .NET < 4.5. I hope it makes sense. I would like to
> clarify
> > this with Charlie.
>
> What we need is a .NET 4.5 config. This guy has one...
>
> http://
Ah cool, I'll start by adding 4.5 to the whole build script system then.
>
>
> > Also one question for Charlie: in order to see if tests are run
> correctly I
> > created some fixtures which are not supposed to be run directly but via
> my
> > own test code. In order to accomplish that I marked the suite as ignored,
> > but those tests then end up in the build results as ignored, which is not
> > really the case 'cause I'm running them by some other means. I wanted to
> > figure out if there was a way to make NUnit /ignore/ those tests so that
> > they don't show up as ignored.
>
> Put those tests in the test-assembly dll. That's what it's for. To see how
> it's used by other tests, just pick any class there and find references.
>
I see, it makes sense. According to how you would like to do the
"infrastructure change" I guess they may need to stay in a 4.5 isolated
assembly though.
>
> Charlie
>
> > Simone
> >
> >
> > On Tue, Oct 2, 2012 at 9:34 PM, Charlie Poole <email address hidden> wrote:
> >
> >> OK then, so you're safe. I know that their are various express releases
> and
> >> some of them are limited in what they support.
> >>
> >> I haven't loaded and tested that code yet. But the net45 test program is
> >> just a set of tests, not NUnit. It is of course built for .NET 4.5.
> Simone
> >> is working on making sure it will run under NUnit so it may not yet be
> >> complete. Note that some code in nunit.core.tests is under the control
> >> of #if statements, which keep it from being compiled when not wanted.
> >>...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #39 |
Hi Simone,
On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
<email address hidden> wrote:
> inline
Ditto
> On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
> wrote:
>
>> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
>> <email address hidden> wrote:
>> > To summarize, the async feature works under NUnit built for CLR 2, of
>> > course it will use an agent to run tests built for CLR > 2.
>> >
>> > There is a sort of infrastructure problem that I posed already which
>> > concerns how to build and test the async thing. Currently I didn't make
>> any
>> > explicit choice and the build fails if you try to build for CLR < 4,
>> > because it tries to build the .NET 4.5 test assembly.
>> > So far therefore you can successfully run a build with net-4.0, which
>> will
>> > run the new tests as well. Of course I also ran them under NUnit built
>> for
>> > CLR 2 but it's a manual process: exclude the tests from the build, build
>> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
>> previously
>> > built.
>>
>> Yes, that's the infrastructure change I was hoping to avoid by postponing
>> to
>> NUnit 3.0. :-) But never mind... you convinced me.
>>
>
> So you'll take care of that, right? :) Or just share how you would do it
> and I'll do the rest.
I'll take a look after I get VS2012 re-installed. I had to remove the RC because
it messed up C++ compilation under VS2010 - also had to reapply VS2010 SP1.
My thought is to have a build for .NET 4.5 in the script and to modify the
commands to allow you to run tests across different .NET versions.
>
>>
>> > Ideally we would have to come up with a way to say that even when we
>> build
>> > for < 4.5 (there's no 4.5 now but only 4.0 as NAnt doesn't support it
>> yet),
>> > that assembly is still built for 4.5 so that tests can be run on it with
>> > NUnit built for .NET < 4.5. I hope it makes sense. I would like to
>> clarify
>> > this with Charlie.
>>
>> What we need is a .NET 4.5 config. This guy has one...
>>
>> http://
>
>
> Ah cool, I'll start by adding 4.5 to the whole build script system then.
>
I'm in the process of adding it to the NUnitLite script myself.
>>
>>
>> > Also one question for Charlie: in order to see if tests are run
>> correctly I
>> > created some fixtures which are not supposed to be run directly but via
>> my
>> > own test code. In order to accomplish that I marked the suite as ignored,
>> > but those tests then end up in the build results as ignored, which is not
>> > really the case 'cause I'm running them by some other means. I wanted to
>> > figure out if there was a way to make NUnit /ignore/ those tests so that
>> > they don't show up as ignored.
>>
>> Put those tests in the test-assembly dll. That's what it's for. To see how
>> it's used by other tests, just pick any class there and find references.
>>
>
> I see, it makes sense. According to how you would like to do the
> "infrastructure change" I guess they may need to stay in a 4.5 isolated
> assembly though.
Or you could use the regular NUnit tests but conditionally include some
extra tests with async.
Charlie...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #40 |
- test45.txt Edit (740 bytes, text/plain; charset=US-ASCII; name="test45.txt")
Hi Charlie,
Attached is a test for checking the thread id of the task running. If you
can confirm if the test scenario is correctly running as expected, I will
go ahead with the other scenarios.
But for this to happen, NUnit must be able to run this test. Please let me
know the tweak to nunit-agent or any other to make NUnit GUI to run a 4.5
targeted test. Thanks.
Jv
On Wed, Oct 3, 2012 at 10:59 AM, Charlie Poole <email address hidden> wrote:
> Hi Simone,
>
> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
> <email address hidden> wrote:
> > inline
>
> Ditto
>
> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
> > wrote:
> >
> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
> >> <email address hidden> wrote:
> >> > To summarize, the async feature works under NUnit built for CLR 2, of
> >> > course it will use an agent to run tests built for CLR > 2.
> >> >
> >> > There is a sort of infrastructure problem that I posed already which
> >> > concerns how to build and test the async thing. Currently I didn't
> make
> >> any
> >> > explicit choice and the build fails if you try to build for CLR < 4,
> >> > because it tries to build the .NET 4.5 test assembly.
> >> > So far therefore you can successfully run a build with net-4.0, which
> >> will
> >> > run the new tests as well. Of course I also ran them under NUnit built
> >> for
> >> > CLR 2 but it's a manual process: exclude the tests from the build,
> build
> >> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
> >> previously
> >> > built.
> >>
> >> Yes, that's the infrastructure change I was hoping to avoid by
> postponing
> >> to
> >> NUnit 3.0. :-) But never mind... you convinced me.
> >>
> >
> > So you'll take care of that, right? :) Or just share how you would do it
> > and I'll do the rest.
>
> I'll take a look after I get VS2012 re-installed. I had to remove the RC
> because
> it messed up C++ compilation under VS2010 - also had to reapply VS2010 SP1.
>
> My thought is to have a build for .NET 4.5 in the script and to modify the
> commands to allow you to run tests across different .NET versions.
> >
> >>
> >> > Ideally we would have to come up with a way to say that even when we
> >> build
> >> > for < 4.5 (there's no 4.5 now but only 4.0 as NAnt doesn't support it
> >> yet),
> >> > that assembly is still built for 4.5 so that tests can be run on it
> with
> >> > NUnit built for .NET < 4.5. I hope it makes sense. I would like to
> >> clarify
> >> > this with Charlie.
> >>
> >> What we need is a .NET 4.5 config. This guy has one...
> >>
> >>
> http://
> >
> >
> > Ah cool, I'll start by adding 4.5 to the whole build script system then.
> >
>
> I'm in the process of adding it to the NUnitLite script myself.
>
> >>
> >>
> >> > Also one question for Charlie: in order to see if tests are run
> >> correctly I
> >> > created some fixtures which are not supposed to be run directly but
> via
> >> my
> >> > own test code. In order to accomplish that I marked the suite as
> ignored,
> >> > but those tests then end up in the build results as ignored, which is
> not
> >> > really t...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #41 |
Fyip,
I am using the same RealFixtures file in Simone's project with the same
references but with different test code so the name of the test method is
same but it does not test a void return value.
Jv
On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden> wrote:
> Hi Charlie,
>
> Attached is a test for checking the thread id of the task running. If you
> can confirm if the test scenario is correctly running as expected, I will
> go ahead with the other scenarios.
>
> But for this to happen, NUnit must be able to run this test. Please let me
> know the tweak to nunit-agent or any other to make NUnit GUI to run a 4.5
> targeted test. Thanks.
>
> Jv
>
>
> On Wed, Oct 3, 2012 at 10:59 AM, Charlie Poole <email address hidden> wrote:
>
>> Hi Simone,
>>
>> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
>> <email address hidden> wrote:
>> > inline
>>
>> Ditto
>>
>> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
>> > wrote:
>> >
>> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
>> >> <email address hidden> wrote:
>> >> > To summarize, the async feature works under NUnit built for CLR 2, of
>> >> > course it will use an agent to run tests built for CLR > 2.
>> >> >
>> >> > There is a sort of infrastructure problem that I posed already which
>> >> > concerns how to build and test the async thing. Currently I didn't
>> make
>> >> any
>> >> > explicit choice and the build fails if you try to build for CLR < 4,
>> >> > because it tries to build the .NET 4.5 test assembly.
>> >> > So far therefore you can successfully run a build with net-4.0, which
>> >> will
>> >> > run the new tests as well. Of course I also ran them under NUnit
>> built
>> >> for
>> >> > CLR 2 but it's a manual process: exclude the tests from the build,
>> build
>> >> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
>> >> previously
>> >> > built.
>> >>
>> >> Yes, that's the infrastructure change I was hoping to avoid by
>> postponing
>> >> to
>> >> NUnit 3.0. :-) But never mind... you convinced me.
>> >>
>> >
>> > So you'll take care of that, right? :) Or just share how you would do it
>> > and I'll do the rest.
>>
>> I'll take a look after I get VS2012 re-installed. I had to remove the RC
>> because
>> it messed up C++ compilation under VS2010 - also had to reapply VS2010
>> SP1.
>>
>> My thought is to have a build for .NET 4.5 in the script and to modify the
>> commands to allow you to run tests across different .NET versions.
>> >
>> >>
>> >> > Ideally we would have to come up with a way to say that even when we
>> >> build
>> >> > for < 4.5 (there's no 4.5 now but only 4.0 as NAnt doesn't support it
>> >> yet),
>> >> > that assembly is still built for 4.5 so that tests can be run on it
>> with
>> >> > NUnit built for .NET < 4.5. I hope it makes sense. I would like to
>> >> clarify
>> >> > this with Charlie.
>> >>
>> >> What we need is a .NET 4.5 config. This guy has one...
>> >>
>> >>
>> http://
>> >
>> >
>> > Ah cool, I'll start by adding 4.5 to the whole build script system then.
>> >
>>
>> I'm in the process of adding it to the NUnitLite script m...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : Re: [Bug 1057981] Re: C#5 async tests are not supported | #42 |
Jv, here's a list of issues in the code you provided:
- it does not compile
- even if you make it compile by assigning "await t" to a local
variable, you are asserting that a Task<int?> is equal to a int?
- even if you await on ob.TaskMethod() so that you get back an int? it
still doesn't make much sense to compare those two values, and you should
actually expect them to be different
- the test will nonetheless pass because the two integers? will be
always null as you are invoking Task.FromResult, which completes
synchronously and therefore will have null Task.CurrentId
Simone
On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden> wrote:
> Fyip,
>
> I am using the same RealFixtures file in Simone's project with the same
> references but with different test code so the name of the test method is
> same but it does not test a void return value.
>
> Jv
>
> On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden> wrote:
>
> > Hi Charlie,
> >
> > Attached is a test for checking the thread id of the task running. If you
> > can confirm if the test scenario is correctly running as expected, I will
> > go ahead with the other scenarios.
> >
> > But for this to happen, NUnit must be able to run this test. Please let
> me
> > know the tweak to nunit-agent or any other to make NUnit GUI to run a 4.5
> > targeted test. Thanks.
> >
> > Jv
> >
> >
> > On Wed, Oct 3, 2012 at 10:59 AM, Charlie Poole <email address hidden>
> wrote:
> >
> >> Hi Simone,
> >>
> >> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
> >> <email address hidden> wrote:
> >> > inline
> >>
> >> Ditto
> >>
> >> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
> >> > wrote:
> >> >
> >> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
> >> >> <email address hidden> wrote:
> >> >> > To summarize, the async feature works under NUnit built for CLR 2,
> of
> >> >> > course it will use an agent to run tests built for CLR > 2.
> >> >> >
> >> >> > There is a sort of infrastructure problem that I posed already
> which
> >> >> > concerns how to build and test the async thing. Currently I didn't
> >> make
> >> >> any
> >> >> > explicit choice and the build fails if you try to build for CLR <
> 4,
> >> >> > because it tries to build the .NET 4.5 test assembly.
> >> >> > So far therefore you can successfully run a build with net-4.0,
> which
> >> >> will
> >> >> > run the new tests as well. Of course I also ran them under NUnit
> >> built
> >> >> for
> >> >> > CLR 2 but it's a manual process: exclude the tests from the build,
> >> build
> >> >> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
> >> >> previously
> >> >> > built.
> >> >>
> >> >> Yes, that's the infrastructure change I was hoping to avoid by
> >> postponing
> >> >> to
> >> >> NUnit 3.0. :-) But never mind... you convinced me.
> >> >>
> >> >
> >> > So you'll take care of that, right? :) Or just share how you would do
> it
> >> > and I'll do the rest.
> >>
> >> I'll take a look after I get VS2012 re-installed. I had to remove the RC
> >> because
> >> it messed up C++ compilation under VS2010 - also had to reapply VS2010
> >> SP1.
> >>
> >> My thought ...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #43 |
Yes, it compiles alright. That is not my concern.
I want to test it on NUnit and I want to do the tweaks locally to my NUnit
source by running NUnit on target 2.0 but use the .net 4.5 assembly.
Jv
On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli <email address hidden>wrote:
> Jv, here's a list of issues in the code you provided:
>
> - it does not compile
> - even if you make it compile by assigning "await t" to a local
> variable, you are asserting that a Task<int?> is equal to a int?
> - even if you await on ob.TaskMethod() so that you get back an int? it
> still doesn't make much sense to compare those two values, and you
> should
> actually expect them to be different
> - the test will nonetheless pass because the two integers? will be
> always null as you are invoking Task.FromResult, which completes
> synchronously and therefore will have null Task.CurrentId
>
> Simone
>
> On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden> wrote:
>
> > Fyip,
> >
> > I am using the same RealFixtures file in Simone's project with the same
> > references but with different test code so the name of the test method is
> > same but it does not test a void return value.
> >
> > Jv
> >
> > On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden> wrote:
> >
> > > Hi Charlie,
> > >
> > > Attached is a test for checking the thread id of the task running. If
> you
> > > can confirm if the test scenario is correctly running as expected, I
> will
> > > go ahead with the other scenarios.
> > >
> > > But for this to happen, NUnit must be able to run this test. Please let
> > me
> > > know the tweak to nunit-agent or any other to make NUnit GUI to run a
> 4.5
> > > targeted test. Thanks.
> > >
> > > Jv
> > >
> > >
> > > On Wed, Oct 3, 2012 at 10:59 AM, Charlie Poole <email address hidden>
> > wrote:
> > >
> > >> Hi Simone,
> > >>
> > >> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
> > >> <email address hidden> wrote:
> > >> > inline
> > >>
> > >> Ditto
> > >>
> > >> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
> > >> > wrote:
> > >> >
> > >> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
> > >> >> <email address hidden> wrote:
> > >> >> > To summarize, the async feature works under NUnit built for CLR
> 2,
> > of
> > >> >> > course it will use an agent to run tests built for CLR > 2.
> > >> >> >
> > >> >> > There is a sort of infrastructure problem that I posed already
> > which
> > >> >> > concerns how to build and test the async thing. Currently I
> didn't
> > >> make
> > >> >> any
> > >> >> > explicit choice and the build fails if you try to build for CLR <
> > 4,
> > >> >> > because it tries to build the .NET 4.5 test assembly.
> > >> >> > So far therefore you can successfully run a build with net-4.0,
> > which
> > >> >> will
> > >> >> > run the new tests as well. Of course I also ran them under NUnit
> > >> built
> > >> >> for
> > >> >> > CLR 2 but it's a manual process: exclude the tests from the
> build,
> > >> build
> > >> >> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
> > >> >> previously
> > >> >> > built.
> > >> >>
> > >> >> Yes, that's the infrastr...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #44 |
The actual unit test functionality that I am looking at can be similar to
the output of the main method in this progam -
http://
Jv
On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli <email address hidden>wrote:
> Jv, here's a list of issues in the code you provided:
>
> - it does not compile
> - even if you make it compile by assigning "await t" to a local
> variable, you are asserting that a Task<int?> is equal to a int?
> - even if you await on ob.TaskMethod() so that you get back an int? it
> still doesn't make much sense to compare those two values, and you
> should
> actually expect them to be different
> - the test will nonetheless pass because the two integers? will be
> always null as you are invoking Task.FromResult, which completes
> synchronously and therefore will have null Task.CurrentId
>
> Simone
>
> On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden> wrote:
>
> > Fyip,
> >
> > I am using the same RealFixtures file in Simone's project with the same
> > references but with different test code so the name of the test method is
> > same but it does not test a void return value.
> >
> > Jv
> >
> > On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden> wrote:
> >
> > > Hi Charlie,
> > >
> > > Attached is a test for checking the thread id of the task running. If
> you
> > > can confirm if the test scenario is correctly running as expected, I
> will
> > > go ahead with the other scenarios.
> > >
> > > But for this to happen, NUnit must be able to run this test. Please let
> > me
> > > know the tweak to nunit-agent or any other to make NUnit GUI to run a
> 4.5
> > > targeted test. Thanks.
> > >
> > > Jv
> > >
> > >
> > > On Wed, Oct 3, 2012 at 10:59 AM, Charlie Poole <email address hidden>
> > wrote:
> > >
> > >> Hi Simone,
> > >>
> > >> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
> > >> <email address hidden> wrote:
> > >> > inline
> > >>
> > >> Ditto
> > >>
> > >> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
> > >> > wrote:
> > >> >
> > >> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
> > >> >> <email address hidden> wrote:
> > >> >> > To summarize, the async feature works under NUnit built for CLR
> 2,
> > of
> > >> >> > course it will use an agent to run tests built for CLR > 2.
> > >> >> >
> > >> >> > There is a sort of infrastructure problem that I posed already
> > which
> > >> >> > concerns how to build and test the async thing. Currently I
> didn't
> > >> make
> > >> >> any
> > >> >> > explicit choice and the build fails if you try to build for CLR <
> > 4,
> > >> >> > because it tries to build the .NET 4.5 test assembly.
> > >> >> > So far therefore you can successfully run a build with net-4.0,
> > which
> > >> >> will
> > >> >> > run the new tests as well. Of course I also ran them under NUnit
> > >> built
> > >> >> for
> > >> >> > CLR 2 but it's a manual process: exclude the tests from the
> build,
> > >> build
> > >> >> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
> > >> >> previously
> > >> >> > built.
> > >> >>
> > >> >> Yes, that's the infrastructure ...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #45 |
Jv,
It seems like this bug is getting crowded with general discussion of async.
Let's only post to the bug when we're talking about the bug from now on.
The test is "will this be helpful to folks checking the bug?"
For more general discussions, you can use the developer list or direct
email.
Charlie
On Wed, Oct 3, 2012 at 3:55 PM, Jv <email address hidden> wrote:
> The actual unit test functionality that I am looking at can be similar to
> the output of the main method in this progam -
> http://
>
> Jv
>
> On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli
> <email address hidden>wrote:
>
>> Jv, here's a list of issues in the code you provided:
>>
>> - it does not compile
>> - even if you make it compile by assigning "await t" to a local
>> variable, you are asserting that a Task<int?> is equal to a int?
>> - even if you await on ob.TaskMethod() so that you get back an int? it
>> still doesn't make much sense to compare those two values, and you
>> should
>> actually expect them to be different
>> - the test will nonetheless pass because the two integers? will be
>> always null as you are invoking Task.FromResult, which completes
>> synchronously and therefore will have null Task.CurrentId
>>
>> Simone
>>
>> On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden> wrote:
>>
>> > Fyip,
>> >
>> > I am using the same RealFixtures file in Simone's project with the same
>> > references but with different test code so the name of the test method is
>> > same but it does not test a void return value.
>> >
>> > Jv
>> >
>> > On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden> wrote:
>> >
>> > > Hi Charlie,
>> > >
>> > > Attached is a test for checking the thread id of the task running. If
>> you
>> > > can confirm if the test scenario is correctly running as expected, I
>> will
>> > > go ahead with the other scenarios.
>> > >
>> > > But for this to happen, NUnit must be able to run this test. Please let
>> > me
>> > > know the tweak to nunit-agent or any other to make NUnit GUI to run a
>> 4.5
>> > > targeted test. Thanks.
>> > >
>> > > Jv
>> > >
>> > >
>> > > On Wed, Oct 3, 2012 at 10:59 AM, Charlie Poole <email address hidden>
>> > wrote:
>> > >
>> > >> Hi Simone,
>> > >>
>> > >> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
>> > >> <email address hidden> wrote:
>> > >> > inline
>> > >>
>> > >> Ditto
>> > >>
>> > >> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
>> > >> > wrote:
>> > >> >
>> > >> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
>> > >> >> <email address hidden> wrote:
>> > >> >> > To summarize, the async feature works under NUnit built for CLR
>> 2,
>> > of
>> > >> >> > course it will use an agent to run tests built for CLR > 2.
>> > >> >> >
>> > >> >> > There is a sort of infrastructure problem that I posed already
>> > which
>> > >> >> > concerns how to build and test the async thing. Currently I
>> didn't
>> > >> make
>> > >> >> any
>> > >> >> > explicit choice and the build fails if you try to build for CLR <
>> > 4,
>> > >> >> > because it tries to build the .NET 4.5 test assembly.
>...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : Re: [Nunit-core] [Bug 1057981] Re: C#5 async tests are not supported | #46 |
Hi Charlie, I've committed some changes regarding the build scripts mainly.
Here's what I've done:
- added "net-4.5" support to NAnt as described in the SO question you
linked
- created a .net 4.5 assembly containing tests for async. Created a .net
4.5 assembly containing fixtures which are run programmatically by the
former. The build file of these two assemblies forces the
"nant.
be built if 4.5 is installed (regardless of the target framework of the
build itself)
- modified the build scripts to support net-4.5 as a target framework
(this includes setting some properties and defining the precompiler
conditionals CLR_4_0, NET_4_5, CS_5_0
- modified the code with precompiler conditionals to include NET_4_5
where meaningful
- modified the build scripts so that even if you target other versions
of the .NET fx BUT .NET 4.5 is installed, then:
- the two assemblies above are built
- the tests contained therein are run
This required adding a new NUnit test project containing the 4.5 test
assembly in addition to all the others, without any "runtimeFramework"
attribute specified so that the console will be able to spawn an agent when
it's not itself built for 4.5 but the test assemblies are there.
I hope this makes sense. I admit that I'm not super-happy with the solution
because it involves a lot of conditionals, mainly in the build scripts, all
over the place, but I'm not sure we can do much better with what we have
right now in V2.
The changes are not many though, so it should not take you long to figure
out what I did exactly.
Simone
On Wed, Oct 3, 2012 at 7:29 AM, Charlie Poole <email address hidden> wrote:
> Hi Simone,
>
> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
> <email address hidden> wrote:
> > inline
>
> Ditto
>
> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
> > wrote:
> >
> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
> >> <email address hidden> wrote:
> >> > To summarize, the async feature works under NUnit built for CLR 2, of
> >> > course it will use an agent to run tests built for CLR > 2.
> >> >
> >> > There is a sort of infrastructure problem that I posed already which
> >> > concerns how to build and test the async thing. Currently I didn't
> make
> >> any
> >> > explicit choice and the build fails if you try to build for CLR < 4,
> >> > because it tries to build the .NET 4.5 test assembly.
> >> > So far therefore you can successfully run a build with net-4.0, which
> >> will
> >> > run the new tests as well. Of course I also ran them under NUnit built
> >> for
> >> > CLR 2 but it's a manual process: exclude the tests from the build,
> build
> >> > for CLR 2, invoke nunit-console.exe (CLR 2) on the 4.5 assembly
> >> previously
> >> > built.
> >>
> >> Yes, that's the infrastructure change I was hoping to avoid by
> postponing
> >> to
> >> NUnit 3.0. :-) But never mind... you convinced me.
> >>
> >
> > So you'll take care of that, right? :) Or just share how you would do it
> > and I'll do the rest.
>
> I'll take a look after I get VS2012 re-installed. I had to remov...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : Re: [Bug 1057981] Re: C#5 async tests are not supported | #47 |
Hi Charlie,
Yes, sure.
An observation related to tests from the user perspective only. The "async"
or "Task" or "await", in a test scenario, seems like it will overcook the
way a test method will be written unless the Assert.That makes use of an
expression that will allow an async test to await the expression result.
Jv
On Thu, Oct 4, 2012 at 4:49 AM, Charlie Poole <email address hidden> wrote:
> Jv,
>
> It seems like this bug is getting crowded with general discussion of
> async.
>
> Let's only post to the bug when we're talking about the bug from now on.
> The test is "will this be helpful to folks checking the bug?"
>
> For more general discussions, you can use the developer list or direct
> email.
>
> Charlie
>
> On Wed, Oct 3, 2012 at 3:55 PM, Jv <email address hidden> wrote:
> > The actual unit test functionality that I am looking at can be similar to
> > the output of the main method in this progam -
> > http://
> >
> > Jv
> >
> > On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli
> > <email address hidden>wrote:
> >
> >> Jv, here's a list of issues in the code you provided:
> >>
> >> - it does not compile
> >> - even if you make it compile by assigning "await t" to a local
> >> variable, you are asserting that a Task<int?> is equal to a int?
> >> - even if you await on ob.TaskMethod() so that you get back an int?
> it
> >> still doesn't make much sense to compare those two values, and you
> >> should
> >> actually expect them to be different
> >> - the test will nonetheless pass because the two integers? will be
> >> always null as you are invoking Task.FromResult, which completes
> >> synchronously and therefore will have null Task.CurrentId
> >>
> >> Simone
> >>
> >> On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden> wrote:
> >>
> >> > Fyip,
> >> >
> >> > I am using the same RealFixtures file in Simone's project with the
> same
> >> > references but with different test code so the name of the test
> method is
> >> > same but it does not test a void return value.
> >> >
> >> > Jv
> >> >
> >> > On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden>
> wrote:
> >> >
> >> > > Hi Charlie,
> >> > >
> >> > > Attached is a test for checking the thread id of the task running.
> If
> >> you
> >> > > can confirm if the test scenario is correctly running as expected, I
> >> will
> >> > > go ahead with the other scenarios.
> >> > >
> >> > > But for this to happen, NUnit must be able to run this test. Please
> let
> >> > me
> >> > > know the tweak to nunit-agent or any other to make NUnit GUI to run
> a
> >> 4.5
> >> > > targeted test. Thanks.
> >> > >
> >> > > Jv
> >> > >
> >> > >
> >> > > On Wed, Oct 3, 2012 at 10:59 AM, Charlie Poole <email address hidden>
> >> > wrote:
> >> > >
> >> > >> Hi Simone,
> >> > >>
> >> > >> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
> >> > >> <email address hidden> wrote:
> >> > >> > inline
> >> > >>
> >> > >> Ditto
> >> > >>
> >> > >> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <
> <email address hidden>>
> >> > >> > wrote:
> >> > >> >
> >> > >> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
>...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : Re: [Nunit-core] [Bug 1057981] Re: C#5 async tests are not supported | #48 |
Hi Simone,
Just reading your note, this all sounds like the right thing. I'll get to
the point of actually running your changes in a few days, after some
meetings I'm preparing for.
In fact, I just added a .NET 4.5 build to NUnitLite using pretty much
the same steps, with the exception that NUnitLite tests run themselves,
so there is no issue with needing to run .NET 4.5 using a runner
compiled with .NET 2.0.
Charlie
On Wed, Oct 3, 2012 at 4:27 PM, Simone Busoli
<email address hidden> wrote:
> Hi Charlie, I've committed some changes regarding the build scripts mainly.
> Here's what I've done:
>
> - added "net-4.5" support to NAnt as described in the SO question you
> linked
> - created a .net 4.5 assembly containing tests for async. Created a .net
> 4.5 assembly containing fixtures which are run programmatically by the
> former. The build file of these two assemblies forces the
> "nant.settings.
> be built if 4.5 is installed (regardless of the target framework of the
> build itself)
> - modified the build scripts to support net-4.5 as a target framework
> (this includes setting some properties and defining the precompiler
> conditionals CLR_4_0, NET_4_5, CS_5_0
> - modified the code with precompiler conditionals to include NET_4_5
> where meaningful
> - modified the build scripts so that even if you target other versions
> of the .NET fx BUT .NET 4.5 is installed, then:
> - the two assemblies above are built
> - the tests contained therein are run
>
> This required adding a new NUnit test project containing the 4.5 test
> assembly in addition to all the others, without any "runtimeFramework"
> attribute specified so that the console will be able to spawn an agent when
> it's not itself built for 4.5 but the test assemblies are there.
>
> I hope this makes sense. I admit that I'm not super-happy with the solution
> because it involves a lot of conditionals, mainly in the build scripts, all
> over the place, but I'm not sure we can do much better with what we have
> right now in V2.
> The changes are not many though, so it should not take you long to figure
> out what I did exactly.
>
> Simone
>
> On Wed, Oct 3, 2012 at 7:29 AM, Charlie Poole <email address hidden> wrote:
>
>> Hi Simone,
>>
>> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
>> <email address hidden> wrote:
>> > inline
>>
>> Ditto
>>
>> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
>> > wrote:
>> >
>> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
>> >> <email address hidden> wrote:
>> >> > To summarize, the async feature works under NUnit built for CLR 2, of
>> >> > course it will use an agent to run tests built for CLR > 2.
>> >> >
>> >> > There is a sort of infrastructure problem that I posed already which
>> >> > concerns how to build and test the async thing. Currently I didn't
>> make
>> >> any
>> >> > explicit choice and the build fails if you try to build for CLR < 4,
>> >> > because it tries to build the .NET 4.5 test assembly.
>> >> > So far therefore you can successfully run a build with net-4.0, which
>> >> will...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : Re: [Bug 1057981] Re: C#5 async tests are not supported | #49 |
That idea introduces asynchronous processing, which would be a new feature.
All we want to do here is make tests marked async run without causing
problems. That's what this bug is about. We'll do that by waiting for the
test to finish, so that only one test runs at a time, even if marked async.
For more than that, see NUnitLite or wait for NUnit 3.0!
Charlie
On Wed, Oct 3, 2012 at 4:35 PM, Jv <email address hidden> wrote:
> Hi Charlie,
>
> Yes, sure.
>
> An observation related to tests from the user perspective only. The "async"
> or "Task" or "await", in a test scenario, seems like it will overcook the
> way a test method will be written unless the Assert.That makes use of an
> expression that will allow an async test to await the expression result.
>
> Jv
>
> On Thu, Oct 4, 2012 at 4:49 AM, Charlie Poole <email address hidden> wrote:
>
>> Jv,
>>
>> It seems like this bug is getting crowded with general discussion of
>> async.
>>
>> Let's only post to the bug when we're talking about the bug from now on.
>> The test is "will this be helpful to folks checking the bug?"
>>
>> For more general discussions, you can use the developer list or direct
>> email.
>>
>> Charlie
>>
>> On Wed, Oct 3, 2012 at 3:55 PM, Jv <email address hidden> wrote:
>> > The actual unit test functionality that I am looking at can be similar to
>> > the output of the main method in this progam -
>> > http://
>> >
>> > Jv
>> >
>> > On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli
>> > <email address hidden>wrote:
>> >
>> >> Jv, here's a list of issues in the code you provided:
>> >>
>> >> - it does not compile
>> >> - even if you make it compile by assigning "await t" to a local
>> >> variable, you are asserting that a Task<int?> is equal to a int?
>> >> - even if you await on ob.TaskMethod() so that you get back an int?
>> it
>> >> still doesn't make much sense to compare those two values, and you
>> >> should
>> >> actually expect them to be different
>> >> - the test will nonetheless pass because the two integers? will be
>> >> always null as you are invoking Task.FromResult, which completes
>> >> synchronously and therefore will have null Task.CurrentId
>> >>
>> >> Simone
>> >>
>> >> On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden> wrote:
>> >>
>> >> > Fyip,
>> >> >
>> >> > I am using the same RealFixtures file in Simone's project with the
>> same
>> >> > references but with different test code so the name of the test
>> method is
>> >> > same but it does not test a void return value.
>> >> >
>> >> > Jv
>> >> >
>> >> > On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden>
>> wrote:
>> >> >
>> >> > > Hi Charlie,
>> >> > >
>> >> > > Attached is a test for checking the thread id of the task running.
>> If
>> >> you
>> >> > > can confirm if the test scenario is correctly running as expected, I
>> >> will
>> >> > > go ahead with the other scenarios.
>> >> > >
>> >> > > But for this to happen, NUnit must be able to run this test. Please
>> let
>> >> > me
>> >> > > know the tweak to nunit-agent or any other to make NUnit GUI to run
>> a
>> >> 4.5
>> >> >...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Simone Busoli (simone.busoli) wrote : Re: [Nunit-core] [Bug 1057981] Re: C#5 async tests are not supported | #50 |
On Thu, Oct 4, 2012 at 1:42 AM, Charlie Poole <email address hidden> wrote:
> Hi Simone,
>
> Just reading your note, this all sounds like the right thing. I'll get to
> the point of actually running your changes in a few days, after some
> meetings I'm preparing for.
>
Sure, no prob.
>
> In fact, I just added a .NET 4.5 build to NUnitLite using pretty much
> the same steps, with the exception that NUnitLite tests run themselves,
> so there is no issue with needing to run .NET 4.5 using a runner
> compiled with .NET 2.0.
>
Sounds way easier :)
>
> Charlie
>
>
> On Wed, Oct 3, 2012 at 4:27 PM, Simone Busoli
> <email address hidden> wrote:
> > Hi Charlie, I've committed some changes regarding the build scripts
> mainly.
> > Here's what I've done:
> >
> > - added "net-4.5" support to NAnt as described in the SO question you
> > linked
> > - created a .net 4.5 assembly containing tests for async. Created a
> .net
> > 4.5 assembly containing fixtures which are run programmatically by the
> > former. The build file of these two assemblies forces the
> > "nant.settings.
> only
> > be built if 4.5 is installed (regardless of the target framework of
> the
> > build itself)
> > - modified the build scripts to support net-4.5 as a target framework
> > (this includes setting some properties and defining the precompiler
> > conditionals CLR_4_0, NET_4_5, CS_5_0
> > - modified the code with precompiler conditionals to include NET_4_5
> > where meaningful
> > - modified the build scripts so that even if you target other versions
> > of the .NET fx BUT .NET 4.5 is installed, then:
> > - the two assemblies above are built
> > - the tests contained therein are run
> >
> > This required adding a new NUnit test project containing the 4.5 test
> > assembly in addition to all the others, without any "runtimeFramework"
> > attribute specified so that the console will be able to spawn an agent
> when
> > it's not itself built for 4.5 but the test assemblies are there.
> >
> > I hope this makes sense. I admit that I'm not super-happy with the
> solution
> > because it involves a lot of conditionals, mainly in the build scripts,
> all
> > over the place, but I'm not sure we can do much better with what we have
> > right now in V2.
> > The changes are not many though, so it should not take you long to figure
> > out what I did exactly.
> >
> > Simone
> >
> > On Wed, Oct 3, 2012 at 7:29 AM, Charlie Poole <email address hidden> wrote:
> >
> >> Hi Simone,
> >>
> >> On Tue, Oct 2, 2012 at 1:59 PM, Simone Busoli
> >> <email address hidden> wrote:
> >> > inline
> >>
> >> Ditto
> >>
> >> > On Tue, Oct 2, 2012 at 10:29 PM, Charlie Poole <email address hidden>
> >> > wrote:
> >> >
> >> >> On Tue, Oct 2, 2012 at 1:03 PM, Simone Busoli
> >> >> <email address hidden> wrote:
> >> >> > To summarize, the async feature works under NUnit built for CLR 2,
> of
> >> >> > course it will use an agent to run tests built for CLR > 2.
> >> >> >
> >> >> > There is a sort of infrastructure problem that I posed already
> which
> >> >> > concerns how to build and test the as...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : Re: [Bug 1057981] Re: C#5 async tests are not supported | #51 |
Sure, Charlie!
I am just waiting for the NUnit GUI built with 2.0 to be 4.5 friendly so
that I could test a few simple scenarios.
Jv
On Thu, Oct 4, 2012 at 5:23 AM, Charlie Poole <email address hidden> wrote:
> That idea introduces asynchronous processing, which would be a new feature.
> All we want to do here is make tests marked async run without causing
> problems. That's what this bug is about. We'll do that by waiting for the
> test to finish, so that only one test runs at a time, even if marked async.
>
> For more than that, see NUnitLite or wait for NUnit 3.0!
>
> Charlie
>
> On Wed, Oct 3, 2012 at 4:35 PM, Jv <email address hidden> wrote:
> > Hi Charlie,
> >
> > Yes, sure.
> >
> > An observation related to tests from the user perspective only. The
> "async"
> > or "Task" or "await", in a test scenario, seems like it will overcook the
> > way a test method will be written unless the Assert.That makes use of an
> > expression that will allow an async test to await the expression result.
> >
> > Jv
> >
> > On Thu, Oct 4, 2012 at 4:49 AM, Charlie Poole <email address hidden> wrote:
> >
> >> Jv,
> >>
> >> It seems like this bug is getting crowded with general discussion of
> >> async.
> >>
> >> Let's only post to the bug when we're talking about the bug from now on.
> >> The test is "will this be helpful to folks checking the bug?"
> >>
> >> For more general discussions, you can use the developer list or direct
> >> email.
> >>
> >> Charlie
> >>
> >> On Wed, Oct 3, 2012 at 3:55 PM, Jv <email address hidden> wrote:
> >> > The actual unit test functionality that I am looking at can be
> similar to
> >> > the output of the main method in this progam -
> >> > http://
> >> >
> >> > Jv
> >> >
> >> > On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli
> >> > <email address hidden>wrote:
> >> >
> >> >> Jv, here's a list of issues in the code you provided:
> >> >>
> >> >> - it does not compile
> >> >> - even if you make it compile by assigning "await t" to a local
> >> >> variable, you are asserting that a Task<int?> is equal to a int?
> >> >> - even if you await on ob.TaskMethod() so that you get back an
> int?
> >> it
> >> >> still doesn't make much sense to compare those two values, and you
> >> >> should
> >> >> actually expect them to be different
> >> >> - the test will nonetheless pass because the two integers? will be
> >> >> always null as you are invoking Task.FromResult, which completes
> >> >> synchronously and therefore will have null Task.CurrentId
> >> >>
> >> >> Simone
> >> >>
> >> >> On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden>
> wrote:
> >> >>
> >> >> > Fyip,
> >> >> >
> >> >> > I am using the same RealFixtures file in Simone's project with the
> >> same
> >> >> > references but with different test code so the name of the test
> >> method is
> >> >> > same but it does not test a void return value.
> >> >> >
> >> >> > Jv
> >> >> >
> >> >> > On Wed, Oct 3, 2012 at 2:28 PM, RJV <email address hidden>
> >> wrote:
> >> >> >
> >> >> > > Hi Charlie,
> >> >> > >
> >> >> > > Attached is a test for checking the thread id of ...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #52 |
Jv,
I'm not understanding what you are waiting for. Simone has published a
branch which will do what you want. You can pull, build and use it.
Charlie
On Wed, Oct 3, 2012 at 5:07 PM, Jv <email address hidden> wrote:
> Sure, Charlie!
>
> I am just waiting for the NUnit GUI built with 2.0 to be 4.5 friendly so
> that I could test a few simple scenarios.
>
> Jv
>
> On Thu, Oct 4, 2012 at 5:23 AM, Charlie Poole <email address hidden> wrote:
>
>> That idea introduces asynchronous processing, which would be a new feature.
>> All we want to do here is make tests marked async run without causing
>> problems. That's what this bug is about. We'll do that by waiting for the
>> test to finish, so that only one test runs at a time, even if marked async.
>>
>> For more than that, see NUnitLite or wait for NUnit 3.0!
>>
>> Charlie
>>
>> On Wed, Oct 3, 2012 at 4:35 PM, Jv <email address hidden> wrote:
>> > Hi Charlie,
>> >
>> > Yes, sure.
>> >
>> > An observation related to tests from the user perspective only. The
>> "async"
>> > or "Task" or "await", in a test scenario, seems like it will overcook the
>> > way a test method will be written unless the Assert.That makes use of an
>> > expression that will allow an async test to await the expression result.
>> >
>> > Jv
>> >
>> > On Thu, Oct 4, 2012 at 4:49 AM, Charlie Poole <email address hidden> wrote:
>> >
>> >> Jv,
>> >>
>> >> It seems like this bug is getting crowded with general discussion of
>> >> async.
>> >>
>> >> Let's only post to the bug when we're talking about the bug from now on.
>> >> The test is "will this be helpful to folks checking the bug?"
>> >>
>> >> For more general discussions, you can use the developer list or direct
>> >> email.
>> >>
>> >> Charlie
>> >>
>> >> On Wed, Oct 3, 2012 at 3:55 PM, Jv <email address hidden> wrote:
>> >> > The actual unit test functionality that I am looking at can be
>> similar to
>> >> > the output of the main method in this progam -
>> >> > http://
>> >> >
>> >> > Jv
>> >> >
>> >> > On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli
>> >> > <email address hidden>wrote:
>> >> >
>> >> >> Jv, here's a list of issues in the code you provided:
>> >> >>
>> >> >> - it does not compile
>> >> >> - even if you make it compile by assigning "await t" to a local
>> >> >> variable, you are asserting that a Task<int?> is equal to a int?
>> >> >> - even if you await on ob.TaskMethod() so that you get back an
>> int?
>> >> it
>> >> >> still doesn't make much sense to compare those two values, and you
>> >> >> should
>> >> >> actually expect them to be different
>> >> >> - the test will nonetheless pass because the two integers? will be
>> >> >> always null as you are invoking Task.FromResult, which completes
>> >> >> synchronously and therefore will have null Task.CurrentId
>> >> >>
>> >> >> Simone
>> >> >>
>> >> >> On Wed, Oct 3, 2012 at 11:07 AM, Jv <email address hidden>
>> wrote:
>> >> >>
>> >> >> > Fyip,
>> >> >> >
>> >> >> > I am using the same RealFixtures file in Simone's project with the
>> >> same
>> >> >> > references but with different test code so the name...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #53 |
Yes, all messages happening almost in parallel! :) Will do so and start
sending in the examples. Tell me how to put them on the wiki.
Jv
On Thu, Oct 4, 2012 at 6:20 AM, Charlie Poole <email address hidden> wrote:
> Jv,
>
> I'm not understanding what you are waiting for. Simone has published a
> branch which will do what you want. You can pull, build and use it.
>
> Charlie
>
> On Wed, Oct 3, 2012 at 5:07 PM, Jv <email address hidden> wrote:
> > Sure, Charlie!
> >
> > I am just waiting for the NUnit GUI built with 2.0 to be 4.5 friendly so
> > that I could test a few simple scenarios.
> >
> > Jv
> >
> > On Thu, Oct 4, 2012 at 5:23 AM, Charlie Poole <email address hidden> wrote:
> >
> >> That idea introduces asynchronous processing, which would be a new
> feature.
> >> All we want to do here is make tests marked async run without causing
> >> problems. That's what this bug is about. We'll do that by waiting for
> the
> >> test to finish, so that only one test runs at a time, even if marked
> async.
> >>
> >> For more than that, see NUnitLite or wait for NUnit 3.0!
> >>
> >> Charlie
> >>
> >> On Wed, Oct 3, 2012 at 4:35 PM, Jv <email address hidden> wrote:
> >> > Hi Charlie,
> >> >
> >> > Yes, sure.
> >> >
> >> > An observation related to tests from the user perspective only. The
> >> "async"
> >> > or "Task" or "await", in a test scenario, seems like it will overcook
> the
> >> > way a test method will be written unless the Assert.That makes use of
> an
> >> > expression that will allow an async test to await the expression
> result.
> >> >
> >> > Jv
> >> >
> >> > On Thu, Oct 4, 2012 at 4:49 AM, Charlie Poole <email address hidden>
> wrote:
> >> >
> >> >> Jv,
> >> >>
> >> >> It seems like this bug is getting crowded with general discussion of
> >> >> async.
> >> >>
> >> >> Let's only post to the bug when we're talking about the bug from now
> on.
> >> >> The test is "will this be helpful to folks checking the bug?"
> >> >>
> >> >> For more general discussions, you can use the developer list or
> direct
> >> >> email.
> >> >>
> >> >> Charlie
> >> >>
> >> >> On Wed, Oct 3, 2012 at 3:55 PM, Jv <email address hidden>
> wrote:
> >> >> > The actual unit test functionality that I am looking at can be
> >> similar to
> >> >> > the output of the main method in this progam -
> >> >> > http://
> >> >> >
> >> >> > Jv
> >> >> >
> >> >> > On Wed, Oct 3, 2012 at 3:36 PM, Simone Busoli
> >> >> > <email address hidden>wrote:
> >> >> >
> >> >> >> Jv, here's a list of issues in the code you provided:
> >> >> >>
> >> >> >> - it does not compile
> >> >> >> - even if you make it compile by assigning "await t" to a local
> >> >> >> variable, you are asserting that a Task<int?> is equal to a
> int?
> >> >> >> - even if you await on ob.TaskMethod() so that you get back an
> >> int?
> >> >> it
> >> >> >> still doesn't make much sense to compare those two values, and
> you
> >> >> >> should
> >> >> >> actually expect them to be different
> >> >> >> - the test will nonetheless pass because the two integers?
> will be
> >> >> >> always null as you are invoking Task.FromResult,...
Changed in nunitv2: | |
status: | In Progress → Fix Committed |
Changed in nunitlite: | |
milestone: | none → 0.9 |
assignee: | Simone Busoli (simone.busoli) → Charlie Poole (charlie.poole) |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #54 |
Despite the fact that the bug has been fixed and NUnit can run async tests
correctly, there is this test that can still produce the same result
because of a deliberate bug I introduced in code to simulate the pre-bug
scenario.
Have a look at the code in this link -
http://
Thought it might be of interest and illuminative for some !
Jv
On Sat, Oct 6, 2012 at 8:25 PM, Charlie Poole <email address hidden> wrote:
> ** Changed in: nunitlite
> Milestone: None => 0.9
>
> ** Changed in: nunitlite
> Assignee: Simone Busoli (simone.busoli) => Charlie Poole
> (charlie.poole)
>
> --
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
> Status in NUnit V2 Test Framework:
> Fix Committed
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
--
Regards,
Ravichandran Jv
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Charlie Poole (charlie.poole) wrote : | #55 |
At first glance, this seems to be an error in the test, not a bug
in nunit. But if you think it's a bug, please provide some more
information...
1) Tell us what version of NUnit you used to reproduce it.
2) If possible, please provide a test case (in text form, not a picture)
that will reproduce the bug.
3) Tell us what you think NUnit should do instead of what it's doing.
charlie
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #56 |
- theTests.txt Edit (984 bytes, text/plain; charset=US-ASCII; name="theTests.txt")
- cut.txt Edit (1.1 KiB, text/plain; charset=US-ASCII; name="cut.txt")
Hi Charlie,
The bug that I have highlighted is *a bug in code (reproduced)* not a bug
in NUnit. If it were a bug in NUnit obviously it would have passed.
>> 1) Tell us what version of NUnit you used to reproduce it. - The fixed
branch (although explained above)
It is not a bug in NUnit; it is a bug in code that I reproduced to simulate
the "pre-bug fix" scenario of a test passing regardless.
>>2) If possible, please provide a test case (in text form, not a
picture)that will reproduce the bug.
Attached is the code & test. The attached code and tests also demonstrates,
through the "taskId", that both the tasks are independent of each other and
provides the mechanism to test it, too!
>> 3) Tell us what you think NUnit should do instead of what it's doing.
I hope my "buggy "code/test helps. :) The intent was to test asynchronicity
in tests and have the mechanism to test it. The taskIds and the failing
tests prove that NUnit is functioning correctly despite the buggy code.
Jv
On Sun, Oct 7, 2012 at 9:12 AM, Charlie Poole <email address hidden> wrote:
> At first glance, this seems to be an error in the test, not a bug
> in nunit. But if you think it's a bug, please provide some more
> information...
>
> 1) Tell us what version of NUnit you used to reproduce it.
>
> 2) If possible, please provide a test case (in text form, not a picture)
> that will reproduce the bug.
>
> 3) Tell us what you think NUnit should do instead of what it's doing.
>
> charlie
>
> --
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
> Status in NUnit V2 Test Framework:
> Fix Committed
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
--
Regards,
Ravichandran Jv
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jv (jv-ravichandran) wrote : | #57 |
Sorry, I had modified the CUT, in the previous email, to make it pass and
sent you the corrected one instead.
Attached is the "buggy" one with the Thread.Sleep() on a synchronous Task
within an *async task method*.
Jv
On Sun, Oct 7, 2012 at 9:12 AM, Charlie Poole <email address hidden> wrote:
> At first glance, this seems to be an error in the test, not a bug
> in nunit. But if you think it's a bug, please provide some more
> information...
>
> 1) Tell us what version of NUnit you used to reproduce it.
>
> 2) If possible, please provide a test case (in text form, not a picture)
> that will reproduce the bug.
>
> 3) Tell us what you think NUnit should do instead of what it's doing.
>
> charlie
>
> --
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
> https:/
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
> Status in NUnit V2 Test Framework:
> Fix Committed
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://
>
> MSTest supports async tests
>
> http://
>
> To manage notifications about this bug go to:
> https:/
>
--
Regards,
Ravichandran Jv
http://
Changed in nunitlite: | |
status: | Triaged → Fix Committed |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
Changed in nunit-3.0: | |
assignee: | Simone Busoli (simone.busoli) → Charlie Poole (charlie.poole) |
milestone: | none → 2.9.6 |
Changed in nunitlite: | |
status: | Fix Committed → Fix Released |
Changed in nunit-3.0: | |
importance: | Wishlist → High |
Changed in nunit-3.0: | |
status: | Triaged → Fix Committed |
Changed in nunit-3.0: | |
status: | Fix Committed → Fix Released |
I believe this deserves implementing.
Charlie, do you mind if I look into it?