Bcrdt's SingleThreadContext can throw ObjectDisposedException when a test ends

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

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

@msynk đang làm issue này rồi.

Từ ngày 4/12/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

In All Utilities CI (https://github.com/bitfoundation/bitplatform/actions/runs/47434187171, job 145395007763, net11.0), CollaborationStackTests.An_edit_in_one_client_reaches_another failed in SingleThreadTestMethodAttribute.ExecuteAsync:

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Collections.Concurrent.BlockingCollection`1[...]'
   at System.Collections.Concurrent.BlockingCollection`1.CheckDisposed()
   at System.Collections.Concurrent.BlockingCollection`1.get_Count()
   at System.Collections.Concurrent.BlockingCollection`1.CompleteAdding()
   at Bit.Bcrdt.Tests.SingleThreadContext.Dispose() in SingleThreadContext.cs:line 120

SingleThreadContext.Run disposes its queue in a finally as soon as its consuming loop ends. CompleteAdding marks the queue complete before it reads Count, so the context's thread can see the queue complete and empty, leave the loop and dispose it while Dispose is still inside CompleteAdding on the test's thread. The test itself passed; the helper's teardown failed it.

Ngôn ngữ chính
C#
Star
1.4k
Fork
264
Merge trung bình
5 giờ 25 phút
Pull request đã merge (30 ngày)
447

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 bitfoundation/bitplatform

Tất cả issue của bitfoundation/bitplatform

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.