libplanet icon indicating copy to clipboard operation
libplanet copied to clipboard

Exclude problematic tests

Open OnedgeLee opened this issue 3 years ago • 1 comments

OnedgeLee avatar Oct 13 '22 13:10 OnedgeLee

I've narrowed down the target of this PR, from excluding all testes that makes test flaky, to excluding tests that generates distinguishable error messages.

Still test fails both on netcore-test and unity-test, but remaning tests generates error logs that cannot figure out the reason for now.

For netcore tests, most of failing logs are like follows:

Too long with no output (exceeded 3m0s): context deadline exceeded

For unity tests, most of failing logs are like follows:

System.Threading.ThreadAbortException:
Too long with no output (exceeded 2m0s): context deadline exceeded

For window-netcore-test, some of failing logs are like follows:

Unhandled exception. System.ComponentModel.Win32Exception (6): The handle is invalid.
   at System.Diagnostics.Process.UpdateHasExited()
   at System.Diagnostics.Process.get_HasExited()
   at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.TryGetExitCode(Object process, Int32& exitCode)
   at Microsoft.TestPlatform.TestHostProvider.Hosting.TestHostManagerCallbacks.ExitCallBack(IProcessHelper processHelper, Object process, StringBuilder testHostProcessStdError, Action`1 onHostExited)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.<get_ExitCallBack>b__36_0(Object process)
   at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.<>c__DisplayClass2_0.<<LaunchProcess>b__3>d.MoveNext()
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
[JetBrains dotCover] Analyzed application exited with code '1'
[JetBrains dotCover] Coverage session finished [10/21/2022 4:38:32 PM]
[JetBrains dotCover] Coverage results post-processing started [10/21/2022 4:38:32 PM]
[JetBrains dotCover] Merging snapshots [10/21/2022 4:38:32 PM]
[JetBrains dotCover] Snapshots merging finished [10/21/2022 4:38:32 PM]
[JetBrains dotCover] Report generation started [10/21/2022 4:38:32 PM]
[JetBrains dotCover] Report generation finished [10/21/2022 4:38:33 PM]
[JetBrains dotCover] Coverage results post-processing finished [10/21/2022 4:38:33 PM]

For macos-netcore-test, some of failing logs are like follows:

Test Run Aborted with error System.Exception: One or more errors occurred.
 ---> System.Exception: Unable to read beyond the end of the stream.
   at System.IO.BinaryReader.Read7BitEncodedInt()
   at System.IO.BinaryReader.ReadString()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---.

For unity-test, I think there are some problems more than netcore-tests, since its frequency of failure is a way higher.

OnedgeLee avatar Oct 24 '22 05:10 OnedgeLee

Looks mostly good enough, but unity test is still failing. 😥

greymistcube avatar Oct 24 '22 16:10 greymistcube

Looks mostly good enough, but unity test is still failing. 😥

It's still flaky. All of them are aborted due to timeout, and I think this have to be handled later. (Since problem is not clear for now, and as mentioned on weekly meeting, approach for unity test may changed into a manner of allowlist.

Since some of tests that does not generate specified error message has been removed from skipping list, the failure rate of unity test has been grown, and became hard to pass.

OnedgeLee avatar Oct 25 '22 02:10 OnedgeLee

I'll apply changes for this discussion on another PR after clearly decided. @dahlia May I re-request a review? (since merging is blocked due to rebasing)

OnedgeLee avatar Oct 27 '22 06:10 OnedgeLee

This PR has 45 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Small
Size       : +34 -11
Percentile : 18%

Total files changed: 3

Change summary by file extension:
.yml : +32 -9
.cs : +2 -2

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a balance between between PR complexity and PR review overhead. PRs within the optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detected.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification) of this PR in relation to all other PRs within the repository.


Was this comment helpful? :thumbsup:  :ok_hand:  :thumbsdown: (Email) Customize PullRequestQuantifier for this repository.