Commit 7f2934b
committed
Tests driven by real-world consumer patterns and historical issues
Two additional FT-only tests targeting concrete consumer code paths
identified by reviewing pythonnet's downstream users (QuantConnect/Lean,
Rhino.Inside, Speckle) and historical issues:
test_concurrent_clr_delegate_invocation_from_python
Python callables wrapped as distinct CLR delegate types (PublicDelegate,
StringDelegate, BoolDelegate) and invoked concurrently from worker
threads. Pattern is canonical for embedders that pass Python lambdas
where C# expects a delegate. Hits the DelegateManager.GetDispatcher
Reflection.Emit lock plus Dispatcher.Dispatch's Py.GIL re-acquisition.
test_concurrent_generic_type_binding
36 distinct Dictionary[K,V] / List[K] type-arg pairs resolved
concurrently from N threads. Tracks #2269, #1407, #821
(concurrent ToPython / GenericByName). Exercises ClassManager.cache,
TypeManager.cache, GenericUtil.mapping, and the generic-binding fast
path together.
Also: preserve the InternString single-write invariant under DEBUG.
Previous TryAdd silently masked the assertion that Add() used to
provide. Capture the bool result and Debug.Assert it - same
correctness check, no release-build cost.
Verified:
3.11 - 3.14 GIL (.NET 8/10): 473 passed, 11 skipped, 3/3 runs clean
3.14t (.NET 8/10): 479 passed, 5 skipped per run1 parent 0860ade commit 7f2934b
2 files changed
Lines changed: 62 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
250 | 307 | | |
251 | 308 | | |
252 | 309 | | |
| |||
0 commit comments