From befd47398f156b6af1113b08a63db9da3d7210d9 Mon Sep 17 00:00:00 2001 From: Matt Gabrenya Date: Fri, 6 Oct 2023 15:01:41 -0700 Subject: [PATCH 1/4] refactor: replace 'pause' with 'dhtSync' in tests --- .../{{kebab_case collection_name}}.test.ts.hbs | 4 ++-- .../{{kebab_case entry_type.name}}.test.ts.hbs | 10 +++++----- ...to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" | 6 +++--- .../{{kebab_case collection_name}}.test.ts.hbs | 4 ++-- .../{{kebab_case entry_type.name}}.test.ts.hbs | 10 +++++----- ...to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" | 6 +++--- .../{{kebab_case collection_name}}.test.ts.hbs | 4 ++-- .../{{kebab_case entry_type.name}}.test.ts.hbs | 10 +++++----- .../vanilla/example/tests/hello-world.test.ts.hbs | 4 ++-- ...to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" | 6 +++--- .../{{kebab_case collection_name}}.test.ts.hbs | 4 ++-- .../{{kebab_case entry_type.name}}.test.ts.hbs | 10 +++++----- ...to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" | 6 +++--- 13 files changed, 42 insertions(+), 42 deletions(-) diff --git a/templates/lit/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs b/templates/lit/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs index cd628cb64..955845709 100644 --- a/templates/lit/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs +++ b/templates/lit/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -35,7 +35,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio const createdRecord: Record = await create{{pascal_case referenceable.name}}(alice.cells[0]); assert.ok(createdRecord); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets {{lower_case collection_name}} again collectionOutput = await bob.cells[0].callZome({ diff --git a/templates/lit/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs b/templates/lit/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs index 07fa1f01f..02f8b154e 100644 --- a/templates/lit/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs +++ b/templates/lit/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeDnaHash, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -53,7 +53,7 @@ test('create and read {{pascal_case entry_type.name}}', async () => { assert.ok(record); // Wait for the created entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the created {{pascal_case entry_type.name}} const createReadOutput: Record = await bob.cells[0].callZome({ @@ -107,7 +107,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput0: Record = await bob.cells[0].callZome({ @@ -135,7 +135,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput1: Record = await bob.cells[0].callZome({ @@ -179,7 +179,7 @@ test('create and delete {{pascal_case entry_type.name}}', async () => { assert.ok(deleteActionHash); // Wait for the entry deletion to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob tries to get the deleted {{pascal_case entry_type.name}} const readDeletedOutput = await bob.cells[0].callZome({ diff --git "a/templates/lit/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" "b/templates/lit/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" index 45a3c63f6..dd454e4f1 100644 --- "a/templates/lit/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" +++ "b/templates/lit/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -67,7 +67,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ @@ -104,7 +104,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ diff --git a/templates/svelte/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs b/templates/svelte/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs index cd628cb64..955845709 100644 --- a/templates/svelte/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs +++ b/templates/svelte/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -35,7 +35,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio const createdRecord: Record = await create{{pascal_case referenceable.name}}(alice.cells[0]); assert.ok(createdRecord); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets {{lower_case collection_name}} again collectionOutput = await bob.cells[0].callZome({ diff --git a/templates/svelte/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs b/templates/svelte/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs index 07fa1f01f..02f8b154e 100644 --- a/templates/svelte/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs +++ b/templates/svelte/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeDnaHash, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -53,7 +53,7 @@ test('create and read {{pascal_case entry_type.name}}', async () => { assert.ok(record); // Wait for the created entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the created {{pascal_case entry_type.name}} const createReadOutput: Record = await bob.cells[0].callZome({ @@ -107,7 +107,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput0: Record = await bob.cells[0].callZome({ @@ -135,7 +135,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput1: Record = await bob.cells[0].callZome({ @@ -179,7 +179,7 @@ test('create and delete {{pascal_case entry_type.name}}', async () => { assert.ok(deleteActionHash); // Wait for the entry deletion to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob tries to get the deleted {{pascal_case entry_type.name}} const readDeletedOutput = await bob.cells[0].callZome({ diff --git "a/templates/svelte/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" "b/templates/svelte/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" index 45a3c63f6..dd454e4f1 100644 --- "a/templates/svelte/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" +++ "b/templates/svelte/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -67,7 +67,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ @@ -104,7 +104,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ diff --git a/templates/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs b/templates/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs index cd628cb64..955845709 100644 --- a/templates/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs +++ b/templates/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -35,7 +35,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio const createdRecord: Record = await create{{pascal_case referenceable.name}}(alice.cells[0]); assert.ok(createdRecord); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets {{lower_case collection_name}} again collectionOutput = await bob.cells[0].callZome({ diff --git a/templates/vanilla/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs b/templates/vanilla/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs index 07fa1f01f..02f8b154e 100644 --- a/templates/vanilla/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs +++ b/templates/vanilla/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeDnaHash, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -53,7 +53,7 @@ test('create and read {{pascal_case entry_type.name}}', async () => { assert.ok(record); // Wait for the created entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the created {{pascal_case entry_type.name}} const createReadOutput: Record = await bob.cells[0].callZome({ @@ -107,7 +107,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput0: Record = await bob.cells[0].callZome({ @@ -135,7 +135,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput1: Record = await bob.cells[0].callZome({ @@ -179,7 +179,7 @@ test('create and delete {{pascal_case entry_type.name}}', async () => { assert.ok(deleteActionHash); // Wait for the entry deletion to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob tries to get the deleted {{pascal_case entry_type.name}} const readDeletedOutput = await bob.cells[0].callZome({ diff --git a/templates/vanilla/example/tests/hello-world.test.ts.hbs b/templates/vanilla/example/tests/hello-world.test.ts.hbs index c1e67f066..51a59f2e1 100644 --- a/templates/vanilla/example/tests/hello-world.test.ts.hbs +++ b/templates/vanilla/example/tests/hello-world.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause } from '@holochain/tryorama'; +import { runScenario, dhtSync } from '@holochain/tryorama'; test('send hello and retrieve hellos', async () => { @@ -38,7 +38,7 @@ test('send hello and retrieve hellos', async () => { }); assert.ok(resultBeto); - await pause(1000) // wait for DHT to settle + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Alice gets all hellos const hellosAlice: Array = await aliceCell.callZome({ diff --git "a/templates/vanilla/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" "b/templates/vanilla/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" index 45a3c63f6..dd454e4f1 100644 --- "a/templates/vanilla/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" +++ "b/templates/vanilla/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -67,7 +67,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ @@ -104,7 +104,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ diff --git a/templates/vue/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs b/templates/vue/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs index cd628cb64..955845709 100644 --- a/templates/vue/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs +++ b/templates/vue/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -35,7 +35,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio const createdRecord: Record = await create{{pascal_case referenceable.name}}(alice.cells[0]); assert.ok(createdRecord); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets {{lower_case collection_name}} again collectionOutput = await bob.cells[0].callZome({ diff --git a/templates/vue/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs b/templates/vue/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs index 07fa1f01f..02f8b154e 100644 --- a/templates/vue/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs +++ b/templates/vue/entry-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case entry_type.name}}.test.ts.hbs @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeDnaHash, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -53,7 +53,7 @@ test('create and read {{pascal_case entry_type.name}}', async () => { assert.ok(record); // Wait for the created entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the created {{pascal_case entry_type.name}} const createReadOutput: Record = await bob.cells[0].callZome({ @@ -107,7 +107,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput0: Record = await bob.cells[0].callZome({ @@ -135,7 +135,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => { assert.ok(updatedRecord); // Wait for the updated entry to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the updated {{pascal_case entry_type.name}} const readUpdatedOutput1: Record = await bob.cells[0].callZome({ @@ -179,7 +179,7 @@ test('create and delete {{pascal_case entry_type.name}}', async () => { assert.ok(deleteActionHash); // Wait for the entry deletion to be propagated to the other node. - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob tries to get the deleted {{pascal_case entry_type.name}} const readDeletedOutput = await bob.cells[0].callZome({ diff --git "a/templates/vue/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" "b/templates/vue/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" index 45a3c63f6..dd454e4f1 100644 --- "a/templates/vue/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" +++ "b/templates/vue/link-type/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if to_referenceable}}{{kebab_case from_referenceable.name}}-to-{{kebab_case (plural to_referenceable.name)}}.test.ts{{\302\241if}}.hbs" @@ -1,6 +1,6 @@ import { assert, test } from "vitest"; -import { runScenario, pause, CallableCell } from '@holochain/tryorama'; +import { runScenario, dhtSync, CallableCell } from '@holochain/tryorama'; import { NewEntryAction, ActionHash, Record, AppBundleSource, fakeActionHash, fakeAgentPubKey, fakeEntryHash } from '@holochain/client'; import { decode } from '@msgpack/msgpack'; @@ -67,7 +67,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ @@ -104,7 +104,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer } }); - await pause(1200); + await dhtSync([alice, bob], alice.cells[0].cell_id[0]); // Bob gets the links again linksOutput = await bob.cells[0].callZome({ From 134158b5e1f6fdf45d1700de0b260b1826c34bae Mon Sep 17 00:00:00 2001 From: Matt Gabrenya Date: Fri, 6 Oct 2023 15:01:50 -0700 Subject: [PATCH 2/4] build: cargo lock --- Cargo.lock | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 5916e7857..e4f17fbe5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1744,6 +1744,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -4069,7 +4079,7 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" name = "linux-raw-sys" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" From f50ce22811cecd95a04636d0bae7e085517d6755 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Fri, 3 Nov 2023 11:09:50 +0000 Subject: [PATCH 3/4] Sync lock file --- Cargo.lock | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e4f17fbe5..5916e7857 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1744,16 +1744,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -4079,7 +4069,7 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" name = "linux-raw-sys" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" From 0b53054b3d5f572b8d0f18784398249b47055851 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Fri, 3 Nov 2023 12:53:55 +0000 Subject: [PATCH 4/4] Fix bob reference --- templates/vanilla/example/tests/hello-world.test.ts.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/vanilla/example/tests/hello-world.test.ts.hbs b/templates/vanilla/example/tests/hello-world.test.ts.hbs index 51a59f2e1..2963c635f 100644 --- a/templates/vanilla/example/tests/hello-world.test.ts.hbs +++ b/templates/vanilla/example/tests/hello-world.test.ts.hbs @@ -38,7 +38,7 @@ test('send hello and retrieve hellos', async () => { }); assert.ok(resultBeto); - await dhtSync([alice, bob], alice.cells[0].cell_id[0]); + await dhtSync([alice, beto], alice.cells[0].cell_id[0]); // Alice gets all hellos const hellosAlice: Array = await aliceCell.callZome({