Uh oh!
There was an error while loading. Please reload this page.
Tests: add helper Stress attribute for stress testing - #18452
Conversation
✅ No release notes required |
Uh oh!
There was an error while loading. Please reload this page.
psfinaki
commented
Apr 7, 2025
Good stuff. I think VS allows for "run until failure" but not sure if it stressing the thread pool this much, and also it's not x-plat. Would you mind adding a line about that to the testing guide? :) |
…ize.fs Co-authored-by: Petr <psfinaki@users.noreply.github.com>
majocha
commented
Apr 7, 2025
The difference is VS "run until failure" will execute sequentially if we select only one test case. For example it couldn't reproduce the failure I linked above, while with Hmm, now I think the naming could be better. |
majocha
commented
Apr 7, 2025
I'm not sure if this should to TESTGUIDE or DEVGUIDE? There was a section already to which I added. |
psfinaki
left a comment
There was a problem hiding this comment.
I think this is good enough for now :) Thanks!
psfinaki
commented
Apr 7, 2025
Speaking of naming, I think "Stress" would be even better than "Repeat". |
Repeat attribute for stress testingStress attribute for stress testingmajocha
commented
Apr 7, 2025
Makes sense! But now I'm in decision paralysis where to put such test 😄. This will be a test of test utilities, so it doesn't belong anywhere... |
KevinRansom
commented
Apr 7, 2025
Well, we can always start a testutilities test assembly. With this as the first test, hereafter, we will have no excuse for not testing the hacks we add to the test framework. |
KevinRansom
commented
Apr 7, 2025
I'm guessing many of the smoketests are only smoketests because they are testing that the test framework does something interesting. |
majocha
commented
Apr 7, 2025
Would it be ok to just unlock existing FSharp.Test.Utilities project as a test container? |
Uh oh!
There was an error while loading. Please reload this page.
T-Gro
commented
Apr 8, 2025
I would do it like that as well, keep the tests close to those utilities. |
majocha
commented
Apr 8, 2025
Tests added :) |
Uh oh!
There was an error while loading. Please reload this page.
This is useful for locally stress testing cases that are flaky in parallel execution.
Example usage: replace
[<Fact>]with[<Theory; Stress(Count = 1000)>]Unlike VS "Run until failure" feature which runs sequentially, this will start the test simultaneously many times and run in parallel, stressing the threadpool.
It can be used to locally track down bugs in flaky tests.