-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fsdk,Tests: added FSharpUtil module and tests #17
Conversation
Not sure about |
Fsdk/FSharpUtil.fs
Outdated
|
||
module FSharpUtil = | ||
|
||
module ReflectionlessPrint = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@webwarrior-ws this is related to STRICTER_COMPILATION_BUT_WITH_REFLECTION_AT_RUNTIME , I thought there's no need to bring this code here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/thought/told you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So just delete all SPrintF* functions and tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes; but those were not the only tests, you need to bring the tests in AsyncExtensions.fs (you even worked on them last week!), and AsyncCancellation.fs, and any that are about FSharpUtil please, I don't understand why you didn't make sure to bring them before making the PR
Fsdk/FSharpUtil.fs
Outdated
|
||
let option = OptionBuilder() | ||
|
||
let Retry<'T, 'TException when 'TException :> Exception> sourceFunc retryCount: Async<'T> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this is not the Retry func from NOnion, is this one better? and will it work with NOnion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is more generic (NOnion one only works with Async<unit>
), and also NOnion's uses TorLogger
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok cool; I assume we can refactor NOnion later to use this Retry from Fsdk?
CI is red btw |
And you need to make sure CI runs the tests, otherwise if you just add them like this, they are not being run. |
The thing is, you said that ResultUtils was using FSharpUtil's Either type, or something like that, and it isn't. Just bring the Either type and don't bring any ResultUtils stuff, there's no need to bring that. |
6e867d2
to
4b5eb97
Compare
Fsdk/Fsdk-legacy.fsproj
Outdated
@@ -50,6 +50,7 @@ | |||
<Reference Include="System.Web.Extensions" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="FSharpUtil.fs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@webwarrior-ws nit, please move it one position below AssemblyInfo.fs
I see some CI runs fail because of this flaky test:
I in fact detected this and brought awareness about it here: nblockchain/geewallet@ff4ad70 . @webwarrior-ws can you address the FIXMEs in this PR? By improving the documentation you will gain a better understanding of that function, which in turn will hopefully make you be able to understand how to fix the test to not be flakey anymore 🙏 |
The compiler error |
0cb6dbe
to
1f9257f
Compare
I added documentation. |
Define "timing error"? |
Maybe Async.Sleep is not that precise in terms of time. So sometimes it finishes a couple of milliseconds earlier or later. |
If you're right, then it should be easy to tweak the problematic Sleep call with something higher or lower, to make the test not flakey. |
And this compiler error:
is maybe because a |
b683357
to
29272e0
Compare
2618318
to
480d3d2
Compare
Moved FSharpUtil module from geewallet and added Fsdk.Tests NUnit test project and moved tests for FSharpUtil there. Co-authored-by: Andres G. Aragoneses <[email protected]>
Introduced error margin for minimal run time in "basic test for WhenAnyAndAll" to eliminate random failures.
@webwarrior-ws I fixed the red CI (sorry, it was my bad to recommend you to run fsharpi in legacy scenario, because I was forgetting that it would fail in the stockmono lanes; now I've fixed it properly). I'm merging this now so a new Fsdk package will get published in nuget. With it, tomorrow you can create PR for geewallet that removes FSharpUtil code and uses this new package (and in the case of NOnion, you can do it in a new commit to be added in this PR from yours that is already open: nblockchain/NOnion#55 ). Another thing you can do tomorrow after the above is create a PR to move the stuff in test/testTsv.fsx to Fsdk.Tests project please. |
Moved FSharpUtil module from GWallet.
Added Fsdk.Tests Nunit test project and moved FSharpUtil there.