[Bug]: Intermittent Failure in MergeManyChangeSet stress tests

Đang mở
#1,130 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
csharp
Lĩnh vực
testing-qa

Hướng nghiên cứu

Start with DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs, especially MultiThreadedStressTest and CheckResultContents at the reported lines. Read how the test prepares and applies changes, then run MultiThreadedStressTest(marketCount: 10, priceCount: 50) and the full test suite to investigate the intermittent failure. Done means the stress phase iterates over pre-calculated changes and the test passes reliably.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Specifically, MultiThreadedStressTest(marketCount: 10, priceCount: 50).

Expected expectedPrices to be a subset of {00043 - $17.14 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.7121397], 00031 - $19.81 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:19.6551006], 00029 - $15.87 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:19.6990594], 00026 - $11.98 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.3459877], 00045 - $16.26 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:19.7331625], 00034 - $12.21 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.6549346], 00028 - $13.69 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:20.7164349], 00008 - $16.76 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.9883224], 00039 - $14.28 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.2575177], 00017 - $19.74 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.4937616], 00003 - $16.44 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.4401790], 00012 - $15.08 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.3240127], 00027 - $10.57 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.3489598], 00019 - $16.96 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.6803881], 00007 - $19.79 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:19.9574974], 00010 - $16.34 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.5941191], 00005 - $13.77 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.5584471], 00042 - $18.60 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.8431487], 00048 - $12.38 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.6095954], 00030 - $14.85 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.8428521], 00040 - $10.36 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:20.6624405], 00036 - $13.48 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:21.0277931], 00032 - $11.72 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.8416787], 00021 - $18.73 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.4317234], 00025 - $13.77 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:20.7149507], 00020 - $16.89 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:21.2080025], 00035 - $10.99 (0ce00eb2-6aba-4ae6-a930-0e1d937abc8b) [04:30:19.9152008], 00018 - $19.49 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:19.9572357], 00041 - $17.78 (8796be1f-5fbc-41c5-9b75-d3d9f6eabaf7) [04:30:19.5240783], 00016 - $13.73 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:20.6621514], 00023 - $11.29 (6be74f10-fc3e-4609-aa2d-6c6da1b09091) [04:30:19.6143894], 00049 - $10.38 (908cd9c5-a71e-4d5d-bec1-8be17a11aa74) [04:30:19.6839938], …11 more…}, but items {00027 - $13.59 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:20.6623978], 00033 - $17.30 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:19.9198414], 00017 - $17.87 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:20.6627700], 00034 - $14.25 (5755abff-26f6-492a-908d-38b5270d5877) [04:30:20.8989351]} are not part of the superset.
   at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
   at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
   at FluentAssertions.Execution.AssertionScope.AddPreFormattedFailure(String formattedFailureMessage)
   at FluentAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
   at FluentAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
   at FluentAssertions.Execution.AssertionChain.FailWith(String message, Object[] args)
   at FluentAssertions.Execution.GivenSelector`1.FailWith(String message, Object[] args)
   at FluentAssertions.Execution.GivenSelector`1.FailWith(String message, Func`2[] args)
   at FluentAssertions.Collections.GenericCollectionAssertions`3.<>c__DisplayClass24_0.<BeSubsetOf>b__0(AssertionChain chain)
   at FluentAssertions.Execution.AssertionChain.WithExpectation(String message, Action`1 chain, Object[] args)
   at FluentAssertions.Execution.AssertionChain.WithExpectation(String message, Object arg1, Action`1 chain)
   at FluentAssertions.Collections.GenericCollectionAssertions`3.BeSubsetOf(IEnumerable`1 expectedSuperset, String because, Object[] becauseArgs)
   at DynamicData.Tests.Cache.MergeManyChangeSetsCacheSourceCompareFixture.CheckResultContents(ChangeSetAggregator`2 marketResults, ChangeSetAggregator`2 priceResults, IComparer`1 comparer) in /home/Jake/Projects/DynamicData/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs:line 1093
   at DynamicData.Tests.Cache.MergeManyChangeSetsCacheSourceCompareFixture.MultiThreadedStressTest(Int32 marketCount, Int32 priceCount) in /home/Jake/Projects/DynamicData/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs:line 128
   at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass47_0.<<InvokeTestMethodAsync>b__1>d.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 259
--- End of stack trace from previous location ---
   at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
   at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90

This seems to happen only when running the full test suite, indicating it's not saturating the thread pool. At a glance, I'd wager too much work is being done during the stress phase, and not enough during setup. The goal of a concurrency stress test is to make it as likely as possible for the concurrency mechanisms to overlap, thus exposing a race, and that likelihood goes down the more stuff is being done between concurrency checks. I.E. try re-writing this to pre-calculate the sequences of changes to be made, and then just iterate over them during the stress phase.

Ngôn ngữ chính
C#
Star
1.9k
Fork
194
Merge trung bình
12 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của reactivemarbles/DynamicData

Tất cả issue của reactivemarbles/DynamicData

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.