-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Open
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-multiprocessingtopic-profilingtopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
# test/test_unit.py
import concurrent.futures
...
def exercise(units=11, rounds=2):
with concurrent.futures.ProcessPoolExecutor() as executor:
...
results = list(
executor.map(
step,
[f"app/{i}" for i in range(units)],
[config] * units,
[local_app_data] * units,
[peers_data] * units,
)
)
def step(
unit: str,
config: Mapping[str, str | int | float | bool],
local_app_data: Mapping[str, JSON],
all_units_data: Mapping[ops.testing.UnitID, Mapping[str, JSON]],
) -> tuple[dict[str, JSON] | None, dict[str, JSON], str | None, str]:
...
if __name__ == "__main__":
import sys
exercise(int(sys.argv[1]), int(sys.argv[2]))(jgol-peer) 🦐/c/j/peer (main)> sudo -E env PYTHONPATH=src python -m profiling.sampling test/test_unit.py 100 100
Profiler coordinator error: Error executing script '/code/jgol/peer/test/test_unit.py': Can't pickle <function step at 0x102b7aae0>: it's not found as __main__.stepCPython versions tested on:
3.15
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-multiprocessingtopic-profilingtopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Todo