()
| 2159 | @pytest.mark.threading |
| 2160 | @pytest.mark.s3 |
| 2161 | def test_concurrent_s3fs_init(): |
| 2162 | # GH-39897: lazy concurrent initialization of S3 subsystem should not crash |
| 2163 | code = """if 1: |
| 2164 | import threading |
| 2165 | import pytest |
| 2166 | from pyarrow.fs import (FileSystem, S3FileSystem, |
| 2167 | ensure_s3_initialized, finalize_s3) |
| 2168 | threads = [] |
| 2169 | fn = lambda: FileSystem.from_uri('s3://mf-nwp-models/README.txt') |
| 2170 | for i in range(4): |
| 2171 | thread = threading.Thread(target = fn) |
| 2172 | threads.append(thread) |
| 2173 | thread.start() |
| 2174 | |
| 2175 | for thread in threads: |
| 2176 | thread.join() |
| 2177 | |
| 2178 | finalize_s3() |
| 2179 | """ |
| 2180 | subprocess.check_call([sys.executable, "-c", code]) |
| 2181 | |
| 2182 | |
| 2183 | @pytest.mark.s3 |
nothing calls this directly
no outgoing calls
no test coverage detected