Commit Graph
18 Commits
Author SHA1 Message Date
Stephen Toub 6072e4d3a7 Update license headers (#38793) 2020-07-08 09:23:11 -04:00
Mitchell HwangandMitchell Hwang cf7a3765b4 [wasm] Disable problematic threading tests in System.Threading.Tasks.Tests (#38355)
Co-authored-by: Mitchell Hwang <[email protected]>
2020-06-26 12:39:55 +02:00
Stephen Toub 1705e687a8 Add non-generic TaskCompletionSource (#37452)
- Adds the type, almost an exact copy of `TaskCompletionSource<TResult>`, but creating a `Task` instead of a `Task<TResult>`.  Primary benefits here are symmetry, smaller `Task` object, and not forcing a developer to specify an unnecessary type name.
- Adds tests for both TCS and TCS<TResult>.
- Switches a bunch of usage of the generic type over to the non-generic, both in src and tests.
2020-06-05 10:50:51 -04:00
Fraser Waters 6de3cd306c Add TaskCompletionSource.SetCanceled(CancellationToken) (#32696)
* Add TaskCompletionSource.SetCanceled(CancellationToken)

api-approved by #30862

* Add to ref

* SetCanceled(default)

* Change some tests to use SetCaneled not TrySetCanceled

These tests used SetResult/SetException and TrySetCancelled so it could
pass a token. Changed to use SetCancelled to match the Result/Exception
useage.

* Add SetCanceled(CT) test

* Check exception on re-cancel

* Equal not Equals

* Catch aggregate not TaskCancelled directly

*  Inner not exc

* Markup

* s/m/n
2020-02-25 09:48:29 -05:00
Stephen Toub 60d1224ddd Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (dotnet/corefx#40113)
Mechanical/automated change.  The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.

Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
2019-08-07 21:07:58 -04:00
Stephen Toub 423f255b6d Re-enable xunit warning 2005 (dotnet/corefx#39866)
Commit migrated from https://github.com/dotnet/corefx/commit/7b013c44b8d38df51f3ec8db64bdcb1f83a8b421
2019-07-29 20:56:11 -04:00
Viktor Hofer b661c58b1c Replace netstandard test projects with tfms
Netstandard test projects are broken by design and don't support the
Microsoft.Net.Test.SDK. Replacing the netstandard tfm with the concrete
implementation tfms.


Commit migrated from https://github.com/dotnet/corefx/commit/d29c16c99c6045ee67444a7a693dd4476861c463
2019-05-30 16:18:41 +02:00
Koundinya Veluri 0f3a2abcfa Reenable Task stack guard tests (dotnet/corefx#24087)
Fixed by https://github.com/dotnet/coreclr/pull/14015
Reenables tests in and closes https://github.com/dotnet/corefx/issues/23201

Commit migrated from https://github.com/dotnet/corefx/commit/9d02dcf8fb6035a4958e36117b857f80b5436874
2017-10-02 23:55:23 -04:00
Stephen Toub fe21ecf3e3 Disable hanging "stack guard" tests (dotnet/corefx#23339)
Commit migrated from https://github.com/dotnet/corefx/commit/0547375d71a7b0ea8e81e7690e2e6b0ceb6c70e6
2017-08-17 11:14:11 -04:00
Stephen Toub 63e588bc23 Disable System.Threading.Tasks tests for netfx
Commit migrated from https://github.com/dotnet/corefx/commit/87bdbd66dfb5e4568b57b64afb50d5abfe209121
2017-04-18 10:54:53 -04:00
dotnet-bot b32ddb5d98 Deploy nameof throughout corefx in MemberData
Commit migrated from https://github.com/dotnet/corefx/commit/9c3156b9ada06b8e58ac53d48fc303500bf3e476
2016-02-18 23:58:15 -05:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
stephentoub 2f3eacdd0c Fix small discrepancy in TaskExtensions.Unwrap
This fixes a small behavioral difference between the mscorlib implementation of Unwrap and the corefx implementation of unwrap.  A Task can end in a canceled state but contain a CancellationToken that doesn't have cancellation requested, e.g. if TaskCompletionSource.SetCanceled() is used.  When Unwrap proxies such a task, the mscorlib implementation was appropriately reflecting that no-cancellation-requested state, whereas our corefx implementation was pretending it did have cancellation requested.

This commit fixes the corefx implementation to match, and adds a few additional test cases to verify.


Commit migrated from https://github.com/dotnet/corefx/commit/dcfa285452deebbb71e88d05b8180d193eb82c30
2015-07-21 16:30:27 -04:00
Stephen Toub 907b42f876 Merge pull request dotnet/corefx#2216 from stephentoub/warnings_as_errors
Enable warnings-as-errors for the build

Commit migrated from https://github.com/dotnet/corefx/commit/ab0d91a930d46f7aa720d8e7ac17f63d252c483a
2015-07-01 19:40:37 -04:00
stephentoub 0c8020ecf6 Enable warnings-as-errors for the build
I also explicitly enabled WarningLevel 4 for all projects, and I fixed a few straggling warnings that fire with the VS2013 compiler but not with VS2015 (by design).


Commit migrated from https://github.com/dotnet/corefx/commit/1a732c1b696979a4d5c659e4f35fc990432e66f4
2015-07-01 14:14:37 -04:00
stephentoub 2b643f98e1 Fix TaskExtensions.Unwrap stack dive
In strange but possible task configurations, it's possible to set up a series of Unwrap calls such that the continuations involved will form a very long chain of synchronously-executing calls.  In such cases, without extra measure, the implementation can overflow the stack.  The mscorlib Unwrap implementation takes precautions to avoid this, and ContinueWith (which was used in the previous, slower, standalone Unwrap implementation) has checks to avoid this as well, but currently await does not.  Since our new Unwrap implementation uses the await infrastructure, it's susceptible again.

This commit adds a check to the new Unwrap implementation to avoid the stack dive, as well as porting a test that triggers the stack dive prior to the fix.  Some local benchmarks show little-to-no impact from the additional checks, and it's very rare to hit the fallback path that triggers the async queueing: while the actual numbers will depend on the actual code being run, the size of stack frames, etc., in the test we only hit the fallback case ~8 times out of 12000 iterations, and that's in code trying very hard to force this condition.


Commit migrated from https://github.com/dotnet/corefx/commit/68633d3efa10a43a0650a11af078fddaa8aafa46
2015-06-30 23:29:49 -04:00
stephentoub 5c67dc92a6 Uncomment additional tests
Commit migrated from https://github.com/dotnet/corefx/commit/470e79f737b0b0008d77922866fde020bdd024cf
2015-06-15 14:00:14 -04:00
stephentoub 5aff61a38d Add TaskExtensions.Unwrap tests
This commit provides a System.Threading.Tasks.Tests project that doesn't include all of the tests that @mellinoe is porting.  However, it does include a new set of tests written from scratch for TaskExtensions.Unwrap, which is the portion of System.Threading.Tasks whose source lives in corefx rather than in coreclr.  They are meant to be the primary unit testing for Unwrap, as the existing tests only superficially exercise the functionality.


Commit migrated from https://github.com/dotnet/corefx/commit/e7eeb95167babb03f2a149a0b95833efb9ba181a
2015-06-12 10:55:45 -04:00