-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
by the way, I am going to submit a test PR in corefx too. |
Bit confused by this as you also say you'll accept 8-digit fractions? edit: Oh... I guess you mean you will store 7-digits, but can read more? Also, if you're going to accept 8 digits, I would suggest upping it to 9 digits to be compatible with anything out there which produces nanosecond precision output, such as protobuff. |
9,999,999 is the max fraction value we can accept, we can read more digits only when having leading zeros (e.g. 09999999) and we'll round it at that time.
We'll accept more than 8 digits as long as the parsed number (without the leading zeros) not exceeding 0xFFFFFFF. if you look at the test PR dotnet/corefx#34561 you'll see I have added a test case like yield return new object[] {"00:00:00.0268435455", new TimeSpan(268435)}; which is 10 digits. |
@jkotas there is some corefx tests are expected to fail because of this change https://ci.dot.net/job/dotnet_coreclr/job/master/job/x64_release_windows_nt_corefx_innerloop_prtest/5479/ but I have addressing that in the test PR dotnet/corefx#34561 how usually we handle this cases in such PR's? is there a way disabling this tests for coreclr runs only? or is there a way to fix the used tests in the coreclr CI? |
@tarekgh you can disable them in coreclr like this |
Thanks @danmosemsft |
test Tizen armel Cross Checked Innerloop Build and Test |
Thanks @joshfree for your review. |
@Anipik Could you please take a look at the mirror? It does not seem to be picking up this change. |
* Fix TimeSpan parsing * Temporary disabling the failed CI tests Signed-off-by: dotnet-bot <[email protected]>
* Fix TimeSpan parsing * Temporary disabling the failed CI tests Signed-off-by: dotnet-bot <[email protected]>
* Fix TimeSpan parsing * Temporary disabling the failed CI tests Signed-off-by: dotnet-bot <[email protected]>
Done :) |
* Fix TimeSpan parsing * Temporary disabling the failed CI tests Signed-off-by: dotnet-bot <[email protected]>
* Fix TimeSpan parsing * Temporary disabling the failed CI tests Signed-off-by: dotnet-bot <[email protected]>
* Fix TimeSpan parsing * Temporary disabling the failed CI tests Signed-off-by: dotnet-bot <[email protected]>
* Fix TimeSpan parsing * Temporary disabling the failed CI tests Commit migrated from dotnet/coreclr@e62ee27
This PR is addressing the issues discussed in the closed PR #21077
Summary
We are inconsistent when parsing the fraction part of the time spans especially when having a leading zeros. inconsistency means sometime we throw exception on some fraction string while not throwing in some other similar fractions.
Also, in some cases we parse the fraction incorrectly. here is some examples of the problems in the TimeSpan parsing;
The Fix
The fix here is to make our behavior consistent and produce logical and expected results. The fix is when there is leading zeros, we'll round the number to 7-digits and succeed the parsing. here is the expectation of the cases mentioned above:
Notes