Repository navigation
Commit c02ff70
committed
test_thread: cover ModuleObject thread-safe registries
Two tests for the thread-safe-collections work in 0a9d482:
- test_module_dunder_all_added_once asserts ModuleObject.allNames keeps
add-once semantics; a torn HashSet would surface duplicates in
__all__ on free-threaded builds.
- test_concurrent_module_attribute_access exercises ModuleObject.cache
with concurrent getattr on a CLR namespace. The old plain Dictionary
threw on Add ("duplicate key") under simultaneous misses; the
ConcurrentDictionary version absorbs the race.
Both run on every interpreter (no @freethreaded_only) — they degenerate
to single-threaded smoke checks under the GIL while the FT build
actually exercises contention.1 parent 47bcfef commit c02ff70
1 file changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
| |||
148 | 161 | | |
149 | 162 | | |
150 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
151 | 187 | | |
152 | 188 | | |
153 | 189 | | |
| |||
0 commit comments