pulumi/sdk/nodejs/tests
Justin Van Patten 9e73c75cd6 [sdk/nodejs] Fix hang due to component children cycles
When a resource depends on a local component resource, rather than setting the component resource itself as a dependency, each of the component's descendants is added as a dependency. This can lead to hangs when cycles are introduced.

For example, consider the following parent/child hierarchy, where `ComponentA` is the parent of `ComponentB` and `ComponentB` is the parent of `CustomC`:

```
ComponentA
    |
ComponentB
    |
 CustomC
```

If `ComponentB` specifies it has a dependency on `ComponentA`, the following takes place as part determining the full set of transitive dependencies:

1. `ComponentA`  is a component resource so it isn't added as a dependency, its children are.
2. `ComponentA` has one child: `ComponentB`
3. `ComponentB`  is a component resource so it isn't added as a dependency, its children are.
4. `ComponentB` has one child: `CustomC`, a custom resource.
5. Since `CustomC` is a custom resource, it is added to the set of dependencies.
6. We try to await its URN, but we'll never get it because `RegisterResource` hasn't yet been called for it. And we hang waiting.

To address this, skip looking at a component's children if it is the component from which the dependency is being added.

In the case of the example, at step 3 the dependency expansion will stop: we won't look at `ComponentB`'s children because we're adding the dependency from `ComponentB`.

fix
2023-04-07 07:34:38 -07:00
..
automation Merge #12374 #12397 2023-03-09 17:11:34 +00:00
mockpackage JavaScript fnSerialization match package.json exports (#8893) 2022-02-08 10:22:56 -08:00
runtime [sdk/nodejs] Fix hang due to component children cycles 2023-04-07 07:34:38 -07:00
sxs_ts_test ci: fix sxs test 2022-03-06 14:45:26 -08:00
config.spec.ts Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
constants.ts ci: improve x-plat testing on Windows 2022-03-06 14:45:26 -08:00
init.spec.ts Add license headers 2018-05-22 15:02:47 -07:00
iterable.spec.ts [sdk/nodejs] Cleanup use of `asyncTest` and `assertAsyncThrows` 2022-11-09 15:08:08 -08:00
options.spec.ts [sdk/nodejs] Cleanup use of `asyncTest` and `assertAsyncThrows` 2022-11-09 15:08:08 -08:00
output.spec.ts Add jsonParse to nodejs sdk 2022-12-28 09:30:24 +00:00
provider.spec.ts [sdk/nodejs] Cleanup use of `asyncTest` and `assertAsyncThrows` 2022-11-09 15:08:08 -08:00
resource.spec.ts [sdk/nodejs] Fix hang due to component children cycles 2023-04-07 07:34:38 -07:00
stackReference.spec.ts sdk/node/StackReference: Add getOutputDetails 2023-02-03 16:47:27 -08:00
unwrap.spec.ts [sdk/nodejs] Cleanup use of `asyncTest` and `assertAsyncThrows` 2022-11-09 15:08:08 -08:00
util.ts [sdk/nodejs] Cleanup use of `asyncTest` and `assertAsyncThrows` 2022-11-09 15:08:08 -08:00