File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ from copy import deepcopy
2+ from threading import Thread
3+ from unittest import TestCase
4+
5+ from eventsourcing .dcb .msgpack import Decision
6+
7+
8+ class MyDecision (Decision ):
9+ a : str
10+
11+
12+ class Test (TestCase ):
13+ def test (self ) -> None :
14+ # Trying to isolate segmentation violation in Python3.13 with
15+ # projection using DCB application with ImMemoryDCBRecorder and
16+ # eventsourcing.dcb.msgpack.Decision. One suspect is deepcopy of
17+ # msgspec.Struct subclasses, perhaps when crossing threads. This
18+ # test tries to replicate what InMemoryDCBRecorder does with a
19+ # subscription (deepcopy on a different thread). However, no segv.
20+ m = MyDecision (a = "a" )
21+ self .assertEqual (deepcopy (m ), m )
22+
23+ def f () -> None :
24+ self .assertEqual (deepcopy (m ), m )
25+
26+ t = Thread (target = f )
27+ t .start ()
28+ t .join ()
You can’t perform that action at this time.
0 commit comments