Commit Graph

8 Commits

Author SHA1 Message Date
Fraser Waters 48dbd6c596
Use black to format lib/test ()
Test code should be formatted and linted the same as library code. This
is the first step of that, simply including ./lib/test to the folder
that the black formatter runs on.
2024-04-23 08:29:58 +00:00
Fraser Waters 8db3087d2b Make pythons RPCManager a context variable 2023-07-13 09:59:12 +01:00
Zaid Ajaj d9771012fe Exclude parentUrn when initlaizing Alias.Spec if no_parent is True 2023-01-30 18:11:29 +01:00
Abhinav Gupta e6fc3893fe
sdk/py/stack: Original traceback in wait_for_rpcs
When the `await RPC_MANAGER.rpcs.pop()` explodes,
the traceback is for `RPC_MANAGER.rpcs.pop()`, e.g.

```
error: Program failed with an unhandled exception:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/pulumi/3.43.1/x64/pulumi-language-python-exec", line 179, in <module>
    loop.run_until_complete(coro)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "[..]/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
    await run_pulumi_func(lambda: Stack(func))
  File "[..]/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
    await wait_for_rpcs()
  File "[..]/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 73, in wait_for_rpcs
    await RPC_MANAGER.rpcs.pop()
RecursionError: maximum recursion depth exceeded
```

This isn't super helpful in debugging these errors.

RPC_MANAGER already tracks uncaught excpetions from such RPCs
but wait_for_rpcs doesn't account for these until aftewards.

This changes wait_for_rpcs to reproduce the original tracebacks
when it encounters errors in waiting for RPCs.

The included test verifies that the more helpful traceback is produced.

Refs 
2023-01-18 16:30:25 -08:00
Aaron Friel 3fcad036fc ci: Fix Windows flake with longer timeout 2022-09-14 09:57:02 -07:00
Kyle Pitzen 122d7c25b9
fix(sdk/python): Makes SETTINGS attributes context-aware () 2022-08-23 13:45:37 -04:00
Anton Tayanovskyy d7b9c01999
Fix 7862 ()
* Fix 7862

* Add a unit test that reproduces the timeout

* Add a CHANGELOG entry
2021-09-07 11:30:39 -04:00
Anton Tayanovskyy 13b6cc5eea
Fix reflecting list type annotations ()
* Fix reflecting list type annotations

* Fix typo and add a test case

* Typo
2021-07-30 09:35:16 -04:00