Skip to content

Commit a994d20

Browse files
test(jco): use drop in resoruce lift
1 parent 32d8bdd commit a994d20

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/jco/test/p3/stream.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ suite("stream<T> lifts", () => {
295295
await checkStreamValues({ stream, vals, typeName: "result<string>", assertEqFn: assert.deepEqual });
296296
});
297297

298-
test.only("example-resource", async () => {
298+
test("example-resource", async () => {
299299
assert.instanceOf(instance["jco:test-components/get-stream-async"].getStreamExampleResourceOwn, AsyncFunction);
300300
const disposeSymbol = Symbol.dispose || Symbol.for("dispose");
301301

@@ -313,9 +313,10 @@ suite("stream<T> lifts", () => {
313313
// NOTE: we have to pull all objects out of the stream and drop the stream,
314314
// *before* attempting to call async functions on the resources, to avoid
315315
// recursive re-entrancy into the same component instance
316-
317-
// TODO(fix): streams should be droppable from the host side...
318-
// otherwise we can't force the writer to give up writing?
316+
//
317+
// We use the line below to *ensure* the stream is dropped, and
318+
// correspondingly (somewhat racily) that the async task the writer was undergoing is done.
319+
stream[disposeSymbol]();
319320

320321
let numDisposed = 0;
321322
for (const resource of resources) {

0 commit comments

Comments
 (0)