@agoric/swingset-liveslots 0.10.3-other-dev-8f8782b.0 → 0.10.3-other-dev-fbe72e7.0.fbe72e7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +34 -26
- package/src/boyd-gc.d.ts +12 -0
- package/src/boyd-gc.d.ts.map +1 -0
- package/src/boyd-gc.js +598 -0
- package/src/cache.d.ts +71 -0
- package/src/cache.d.ts.map +1 -0
- package/src/cache.js +3 -2
- package/src/capdata.d.ts +16 -0
- package/src/capdata.d.ts.map +1 -0
- package/src/capdata.js +17 -10
- package/src/collectionManager.d.ts +47 -0
- package/src/collectionManager.d.ts.map +1 -0
- package/src/collectionManager.js +220 -103
- package/src/facetiousness.d.ts +25 -0
- package/src/facetiousness.d.ts.map +1 -0
- package/src/facetiousness.js +1 -1
- package/src/index.d.ts +4 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +4 -2
- package/src/kdebug.d.ts +7 -0
- package/src/kdebug.d.ts.map +1 -0
- package/src/liveslots.d.ts +42 -0
- package/src/liveslots.d.ts.map +1 -0
- package/src/liveslots.js +137 -305
- package/src/message.d.ts +49 -0
- package/src/message.d.ts.map +1 -0
- package/src/message.js +9 -5
- package/src/parseVatSlots.d.ts +125 -0
- package/src/parseVatSlots.d.ts.map +1 -0
- package/src/parseVatSlots.js +1 -1
- package/src/types-index.d.ts +4 -0
- package/src/types-index.js +2 -0
- package/src/types.d.ts +81 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +14 -7
- package/src/vatDataTypes.d.ts +170 -0
- package/src/vatDataTypes.d.ts.map +1 -0
- package/src/vatDataTypes.ts +272 -0
- package/src/vatstore-iterators.d.ts +4 -0
- package/src/vatstore-iterators.d.ts.map +1 -0
- package/src/vatstore-iterators.js +2 -0
- package/src/vatstore-usage.md +198 -0
- package/src/virtualObjectManager.d.ts +44 -0
- package/src/virtualObjectManager.d.ts.map +1 -0
- package/src/virtualObjectManager.js +254 -84
- package/src/virtualReferences.d.ts +61 -0
- package/src/virtualReferences.d.ts.map +1 -0
- package/src/virtualReferences.js +135 -26
- package/src/vpid-tracking.md +92 -0
- package/src/watchedPromises.d.ts +31 -0
- package/src/watchedPromises.d.ts.map +1 -0
- package/src/watchedPromises.js +81 -24
- package/test/{test-baggage.js → baggage.test.js} +1 -2
- package/test/{test-cache.js → cache.test.js} +0 -1
- package/test/clear-collection.test.js +586 -0
- package/test/{test-collection-schema-refcount.js → collection-schema-refcount.test.js} +1 -2
- package/test/{test-collection-upgrade.js → collection-upgrade.test.js} +1 -3
- package/test/{test-collections.js → collections.test.js} +183 -18
- package/test/{test-dropped-collection-weakrefs.js → dropped-collection-weakrefs.test.js} +1 -2
- package/test/dropped-weakset-9939.test.js +80 -0
- package/test/dummyMeterControl.d.ts +2 -0
- package/test/dummyMeterControl.d.ts.map +1 -0
- package/test/dummyMeterControl.js +1 -1
- package/test/{test-durabilityChecks.js → durabilityChecks.test.js} +4 -4
- package/test/engine-gc.d.ts +3 -0
- package/test/engine-gc.d.ts.map +1 -0
- package/test/exo-utils.js +70 -0
- package/test/{test-facetiousness.js → facetiousness.test.js} +1 -2
- package/test/gc-and-finalize.d.ts +5 -0
- package/test/gc-and-finalize.d.ts.map +1 -0
- package/test/gc-and-finalize.js +30 -1
- package/test/gc-before-finalizer.test.js +230 -0
- package/test/gc-helpers.js +4 -5
- package/test/{test-gc-sensitivity.js → gc-sensitivity.test.js} +2 -2
- package/test/handled-promises.test.js +872 -0
- package/test/{test-initial-vrefs.js → initial-vrefs.test.js} +13 -20
- package/test/liveslots-helpers.d.ts +64 -0
- package/test/liveslots-helpers.d.ts.map +1 -0
- package/test/liveslots-helpers.js +13 -7
- package/test/{test-liveslots-mock-gc.js → liveslots-mock-gc.test.js} +101 -2
- package/test/{test-liveslots-real-gc.js → liveslots-real-gc.test.js} +73 -46
- package/test/{test-liveslots.js → liveslots.test.js} +17 -18
- package/test/mock-gc.js +1 -0
- package/test/storeGC/{test-lifecycle.js → lifecycle.test.js} +15 -14
- package/test/storeGC/{test-refcount-management.js → refcount-management.test.js} +1 -2
- package/test/storeGC/{test-scalar-store-kind.js → scalar-store-kind.test.js} +0 -1
- package/test/storeGC/{test-weak-key.js → weak-key.test.js} +1 -2
- package/test/strict-test-env-upgrade.test.js +94 -0
- package/test/util.d.ts +25 -0
- package/test/util.d.ts.map +1 -0
- package/test/util.js +4 -4
- package/test/vat-environment.test.js +65 -0
- package/test/vat-util.d.ts +9 -0
- package/test/vat-util.d.ts.map +1 -0
- package/test/vat-util.js +2 -2
- package/test/virtual-objects/{test-cease-recognition.js → cease-recognition.test.js} +2 -2
- package/test/virtual-objects/{test-cross-facet.js → cross-facet.test.js} +5 -4
- package/test/virtual-objects/{test-empty-data.js → empty-data.test.js} +1 -2
- package/test/virtual-objects/{test-facets.js → facets.test.js} +1 -2
- package/test/virtual-objects/{test-kind-changes.js → kind-changes.test.js} +2 -2
- package/test/virtual-objects/{test-reachable-vrefs.js → reachable-vrefs.test.js} +2 -2
- package/test/virtual-objects/{test-rep-tostring.js → rep-tostring.test.js} +3 -5
- package/test/virtual-objects/{test-retain-remotable.js → retain-remotable.test.js} +25 -24
- package/test/virtual-objects/set-debug-label-instances.js +1 -1
- package/test/virtual-objects/state-shape.test.js +389 -0
- package/test/virtual-objects/{test-virtualObjectGC.js → virtualObjectGC.test.js} +39 -38
- package/test/virtual-objects/{test-virtualObjectManager.js → virtualObjectManager.test.js} +104 -8
- package/test/virtual-objects/{test-vo-real-gc.js → vo-real-gc.test.js} +8 -8
- package/test/virtual-objects/{test-weakcollections-vref-handling.js → weakcollections-vref-handling.test.js} +1 -2
- package/test/{test-vo-test-harness.js → vo-test-harness.test.js} +13 -10
- package/test/{test-vpid-liveslots.js → vpid-liveslots.test.js} +105 -5
- package/test/waitUntilQuiescent.d.ts +3 -0
- package/test/waitUntilQuiescent.d.ts.map +1 -0
- package/test/waitUntilQuiescent.js +2 -1
- package/test/weakset-dropped-remotable.test.js +50 -0
- package/tools/fakeCollectionManager.d.ts +14 -0
- package/tools/fakeCollectionManager.d.ts.map +1 -0
- package/tools/fakeCollectionManager.js +44 -0
- package/tools/fakeVirtualObjectManager.d.ts +32 -0
- package/tools/fakeVirtualObjectManager.d.ts.map +1 -0
- package/tools/fakeVirtualObjectManager.js +62 -0
- package/tools/fakeVirtualSupport.d.ts +278 -0
- package/tools/fakeVirtualSupport.d.ts.map +1 -0
- package/tools/fakeVirtualSupport.js +389 -0
- package/tools/prepare-strict-test-env.d.ts +37 -0
- package/tools/prepare-strict-test-env.d.ts.map +1 -0
- package/tools/prepare-strict-test-env.js +124 -0
- package/tools/prepare-test-env.d.ts +2 -0
- package/tools/prepare-test-env.d.ts.map +1 -0
- package/tools/prepare-test-env.js +13 -0
- package/tools/setup-vat-data.d.ts +9 -0
- package/tools/setup-vat-data.d.ts.map +1 -0
- package/tools/setup-vat-data.js +95 -0
- package/tools/vo-test-harness.d.ts +33 -0
- package/tools/vo-test-harness.d.ts.map +1 -0
- package/tools/vo-test-harness.js +164 -0
- package/CHANGELOG.md +0 -61
- package/test/kmarshal.js +0 -79
- package/test/test-handled-promises.js +0 -360
- package/test/virtual-objects/test-state-shape.js +0 -298
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import test from 'ava';
|
|
2
|
-
import '@endo/init/debug.js';
|
|
3
3
|
|
|
4
4
|
import { Far } from '@endo/marshal';
|
|
5
|
+
import { krefOf, kser, kslot } from '@agoric/kmarshal';
|
|
6
|
+
import { avaRetry } from '@agoric/internal/tools/avaRetry.js';
|
|
5
7
|
import {
|
|
6
8
|
setupTestLiveslots,
|
|
7
9
|
findSyscallsByType,
|
|
8
10
|
} from '../liveslots-helpers.js';
|
|
9
|
-
import { krefOf, kser, kslot } from '../kmarshal.js';
|
|
10
11
|
import { parseVatSlot } from '../../src/parseVatSlots.js';
|
|
11
12
|
|
|
12
13
|
// Legs:
|
|
@@ -437,10 +438,10 @@ async function voLifeCycleTest1(t, isf) {
|
|
|
437
438
|
await dispatchMessageSuccessfully('dropHeld');
|
|
438
439
|
assertState(v, vref, false, 'erv');
|
|
439
440
|
}
|
|
440
|
-
test.serial
|
|
441
|
+
avaRetry(test.serial, 'VO lifecycle 1 unfaceted', async t => {
|
|
441
442
|
await voLifeCycleTest1(t, false);
|
|
442
443
|
});
|
|
443
|
-
test.serial
|
|
444
|
+
avaRetry(test.serial, 'VO lifecycle 1 faceted', async t => {
|
|
444
445
|
await voLifeCycleTest1(t, true);
|
|
445
446
|
});
|
|
446
447
|
|
|
@@ -519,10 +520,10 @@ async function voLifeCycleTest2(t, isf) {
|
|
|
519
520
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), []);
|
|
520
521
|
}
|
|
521
522
|
|
|
522
|
-
test.serial
|
|
523
|
+
avaRetry(test.serial, 'VO lifecycle 2 unfaceted', async t => {
|
|
523
524
|
await voLifeCycleTest2(t, false);
|
|
524
525
|
});
|
|
525
|
-
test.serial
|
|
526
|
+
avaRetry(test.serial, 'VO lifecycle 2 faceted', async t => {
|
|
526
527
|
await voLifeCycleTest2(t, true);
|
|
527
528
|
});
|
|
528
529
|
|
|
@@ -567,10 +568,10 @@ async function voLifeCycleTest3(t, isf) {
|
|
|
567
568
|
t.deepEqual(findSyscallsByType(v.log, 'dropExports'), []);
|
|
568
569
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), []);
|
|
569
570
|
}
|
|
570
|
-
test.serial
|
|
571
|
+
avaRetry(test.serial, 'VO lifecycle 3 unfaceted', async t => {
|
|
571
572
|
await voLifeCycleTest3(t, false);
|
|
572
573
|
});
|
|
573
|
-
test.serial
|
|
574
|
+
avaRetry(test.serial, 'VO lifecycle 3 faceted', async t => {
|
|
574
575
|
await voLifeCycleTest3(t, true);
|
|
575
576
|
});
|
|
576
577
|
|
|
@@ -600,10 +601,10 @@ async function voLifeCycleTest4(t, isf) {
|
|
|
600
601
|
const expected = { type: 'retireExports', slots: [vref] };
|
|
601
602
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), [expected]);
|
|
602
603
|
}
|
|
603
|
-
test.serial
|
|
604
|
+
avaRetry(test.serial, 'VO lifecycle 4 unfaceted', async t => {
|
|
604
605
|
await voLifeCycleTest4(t, false);
|
|
605
606
|
});
|
|
606
|
-
test.serial
|
|
607
|
+
avaRetry(test.serial, 'VO lifecycle 4 faceted', async t => {
|
|
607
608
|
await voLifeCycleTest4(t, true);
|
|
608
609
|
});
|
|
609
610
|
|
|
@@ -640,10 +641,10 @@ async function voLifeCycleTest5(t, isf) {
|
|
|
640
641
|
t.deepEqual(findSyscallsByType(v.log, 'dropExports'), []);
|
|
641
642
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), []);
|
|
642
643
|
}
|
|
643
|
-
test.serial
|
|
644
|
+
avaRetry(test.serial, 'VO lifecycle 5 unfaceted', async t => {
|
|
644
645
|
await voLifeCycleTest5(t, false);
|
|
645
646
|
});
|
|
646
|
-
test.serial
|
|
647
|
+
avaRetry(test.serial, 'VO lifecycle 5 faceted', async t => {
|
|
647
648
|
await voLifeCycleTest5(t, true);
|
|
648
649
|
});
|
|
649
650
|
|
|
@@ -689,10 +690,10 @@ async function voLifeCycleTest6(t, isf) {
|
|
|
689
690
|
const expected = { type: 'retireExports', slots: [vref] };
|
|
690
691
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), [expected]);
|
|
691
692
|
}
|
|
692
|
-
test.serial
|
|
693
|
+
avaRetry(test.serial, 'VO lifecycle 6 unfaceted', async t => {
|
|
693
694
|
await voLifeCycleTest6(t, false);
|
|
694
695
|
});
|
|
695
|
-
test.serial
|
|
696
|
+
avaRetry(test.serial, 'VO lifecycle 6 faceted', async t => {
|
|
696
697
|
await voLifeCycleTest6(t, true);
|
|
697
698
|
});
|
|
698
699
|
|
|
@@ -730,10 +731,10 @@ async function voLifeCycleTest7(t, isf) {
|
|
|
730
731
|
const expected = { type: 'retireExports', slots: [vref] };
|
|
731
732
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), [expected]);
|
|
732
733
|
}
|
|
733
|
-
test.serial
|
|
734
|
+
avaRetry(test.serial, 'VO lifecycle 7 unfaceted', async t => {
|
|
734
735
|
await voLifeCycleTest7(t, false);
|
|
735
736
|
});
|
|
736
|
-
test.serial
|
|
737
|
+
avaRetry(test.serial, 'VO lifecycle 7 faceted', async t => {
|
|
737
738
|
await voLifeCycleTest7(t, true);
|
|
738
739
|
});
|
|
739
740
|
|
|
@@ -779,15 +780,15 @@ async function voLifeCycleTest8(t, isf) {
|
|
|
779
780
|
const expected = { type: 'retireExports', slots: [vref] };
|
|
780
781
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), [expected]);
|
|
781
782
|
}
|
|
782
|
-
test.serial
|
|
783
|
+
avaRetry(test.serial, 'VO lifecycle 8 unfaceted', async t => {
|
|
783
784
|
await voLifeCycleTest8(t, false);
|
|
784
785
|
});
|
|
785
|
-
test.serial
|
|
786
|
+
avaRetry(test.serial, 'VO lifecycle 8 faceted', async t => {
|
|
786
787
|
await voLifeCycleTest8(t, true);
|
|
787
788
|
});
|
|
788
789
|
|
|
789
790
|
// multifacet export test 1: no export
|
|
790
|
-
test.serial
|
|
791
|
+
avaRetry(test.serial, 'VO multifacet export 1', async t => {
|
|
791
792
|
const { v, dispatchMessageSuccessfully } = await setupTestLiveslots(
|
|
792
793
|
t,
|
|
793
794
|
buildRootObject,
|
|
@@ -808,7 +809,7 @@ test.serial('VO multifacet export 1', async t => {
|
|
|
808
809
|
});
|
|
809
810
|
|
|
810
811
|
// multifacet export test 2a: export A, drop A, retire A
|
|
811
|
-
test.serial
|
|
812
|
+
avaRetry(test.serial, 'VO multifacet export 2a', async t => {
|
|
812
813
|
const { v, dispatchMessageSuccessfully, dispatchDropExports } =
|
|
813
814
|
await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
814
815
|
const vref = facetRef(true, thingVref(true, 2), '0');
|
|
@@ -836,7 +837,7 @@ test.serial('VO multifacet export 2a', async t => {
|
|
|
836
837
|
});
|
|
837
838
|
|
|
838
839
|
// multifacet export test 2b: export B, drop B, retire B
|
|
839
|
-
test.serial
|
|
840
|
+
avaRetry(test.serial, 'VO multifacet export 2b', async t => {
|
|
840
841
|
const { v, dispatchMessageSuccessfully, dispatchDropExports } =
|
|
841
842
|
await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
842
843
|
const vref = facetRef(true, thingVref(true, 2), '1');
|
|
@@ -863,7 +864,7 @@ test.serial('VO multifacet export 2b', async t => {
|
|
|
863
864
|
});
|
|
864
865
|
|
|
865
866
|
// multifacet export test 3abba: export A, export B, drop B, drop A, retire
|
|
866
|
-
test.serial
|
|
867
|
+
avaRetry(test.serial, 'VO multifacet export 3abba', async t => {
|
|
867
868
|
const { v, dispatchMessageSuccessfully, dispatchDropExports } =
|
|
868
869
|
await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
869
870
|
const vrefA = facetRef(true, thingVref(true, 2), '0');
|
|
@@ -901,7 +902,7 @@ test.serial('VO multifacet export 3abba', async t => {
|
|
|
901
902
|
});
|
|
902
903
|
|
|
903
904
|
// multifacet export test 3abab: export A, export B, drop A, drop B, retire
|
|
904
|
-
test.serial
|
|
905
|
+
avaRetry(test.serial, 'VO multifacet export 3abab', async t => {
|
|
905
906
|
const { v, dispatchMessageSuccessfully, dispatchDropExports } =
|
|
906
907
|
await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
907
908
|
const vrefA = facetRef(true, thingVref(true, 2), '0');
|
|
@@ -938,7 +939,7 @@ test.serial('VO multifacet export 3abab', async t => {
|
|
|
938
939
|
t.deepEqual(findSyscallsByType(v.log, 'retireExports'), [expected]);
|
|
939
940
|
});
|
|
940
941
|
|
|
941
|
-
test.serial
|
|
942
|
+
avaRetry(test.serial, 'VO multifacet markers only', async t => {
|
|
942
943
|
const { v, dispatchMessageSuccessfully } = await setupTestLiveslots(
|
|
943
944
|
t,
|
|
944
945
|
buildRootObject,
|
|
@@ -993,10 +994,10 @@ async function voRefcountManagementTest1(t, isf) {
|
|
|
993
994
|
t.is(fakestore.get(`vom.rc.${baseRef}`), undefined);
|
|
994
995
|
assertState(v, vref, false, 'erv');
|
|
995
996
|
}
|
|
996
|
-
test.serial
|
|
997
|
+
avaRetry(test.serial, 'VO refcount management 1 unfaceted', async t => {
|
|
997
998
|
await voRefcountManagementTest1(t, false);
|
|
998
999
|
});
|
|
999
|
-
test.serial
|
|
1000
|
+
avaRetry(test.serial, 'VO refcount management 1 faceted', async t => {
|
|
1000
1001
|
await voRefcountManagementTest1(t, true);
|
|
1001
1002
|
});
|
|
1002
1003
|
|
|
@@ -1034,10 +1035,10 @@ async function voRefcountManagementTest2(t, isf) {
|
|
|
1034
1035
|
t.is(fakestore.get(`vom.rc.${baseRef}`), undefined);
|
|
1035
1036
|
assertState(v, vref, false, 'erv');
|
|
1036
1037
|
}
|
|
1037
|
-
test.serial
|
|
1038
|
+
avaRetry(test.serial, 'VO refcount management 2 unfaceted', async t => {
|
|
1038
1039
|
await voRefcountManagementTest2(t, false);
|
|
1039
1040
|
});
|
|
1040
|
-
test.serial
|
|
1041
|
+
avaRetry(test.serial, 'VO refcount management 2 faceted', async t => {
|
|
1041
1042
|
await voRefcountManagementTest2(t, true);
|
|
1042
1043
|
});
|
|
1043
1044
|
|
|
@@ -1084,15 +1085,15 @@ async function voRefcountManagementTest3(t, isf) {
|
|
|
1084
1085
|
t.is(fakestore.get(`vom.${holderVrefs[1]}`), undefined);
|
|
1085
1086
|
t.is(fakestore.get(`vom.${holderVrefs[2]}`), undefined);
|
|
1086
1087
|
}
|
|
1087
|
-
test.serial
|
|
1088
|
+
avaRetry(test.serial, 'VO refcount management 3 unfaceted', async t => {
|
|
1088
1089
|
await voRefcountManagementTest3(t, false);
|
|
1089
1090
|
});
|
|
1090
|
-
test.serial
|
|
1091
|
+
avaRetry(test.serial, 'VO refcount management 3 faceted', async t => {
|
|
1091
1092
|
await voRefcountManagementTest3(t, true);
|
|
1092
1093
|
});
|
|
1093
1094
|
|
|
1094
1095
|
// prettier-ignore
|
|
1095
|
-
test.serial
|
|
1096
|
+
avaRetry(test.serial, 'presence refcount management 1', async t => {
|
|
1096
1097
|
const { v, dispatchMessageSuccessfully } = await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
1097
1098
|
const { fakestore } = v;
|
|
1098
1099
|
|
|
@@ -1131,7 +1132,7 @@ test.serial('presence refcount management 1', async t => {
|
|
|
1131
1132
|
});
|
|
1132
1133
|
|
|
1133
1134
|
// prettier-ignore
|
|
1134
|
-
test.serial
|
|
1135
|
+
avaRetry(test.serial, 'presence refcount management 2', async t => {
|
|
1135
1136
|
const { v, dispatchMessageSuccessfully } = await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
1136
1137
|
const { fakestore } = v;
|
|
1137
1138
|
|
|
@@ -1169,7 +1170,7 @@ test.serial('presence refcount management 2', async t => {
|
|
|
1169
1170
|
});
|
|
1170
1171
|
|
|
1171
1172
|
// prettier-ignore
|
|
1172
|
-
test.serial
|
|
1173
|
+
avaRetry(test.serial, 'remotable refcount management 1', async t => {
|
|
1173
1174
|
const { v, dispatchMessageSuccessfully } = await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
1174
1175
|
const { fakestore } = v;
|
|
1175
1176
|
|
|
@@ -1212,7 +1213,7 @@ test.serial('remotable refcount management 1', async t => {
|
|
|
1212
1213
|
});
|
|
1213
1214
|
|
|
1214
1215
|
// prettier-ignore
|
|
1215
|
-
test.serial
|
|
1216
|
+
avaRetry(test.serial, 'remotable refcount management 2', async t => {
|
|
1216
1217
|
const { v, dispatchMessageSuccessfully } = await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
1217
1218
|
const { fakestore } = v;
|
|
1218
1219
|
|
|
@@ -1255,15 +1256,15 @@ async function voWeakKeyGCTest(t, isf) {
|
|
|
1255
1256
|
t.is(testHooks.countWeakKeysForCollection(aWeakSet), 0);
|
|
1256
1257
|
t.is(fakestore.get(`vom.${baseRef}`), undefined);
|
|
1257
1258
|
}
|
|
1258
|
-
test.serial
|
|
1259
|
+
avaRetry(test.serial, 'verify VO weak key GC unfaceted', async t => {
|
|
1259
1260
|
await voWeakKeyGCTest(t, false);
|
|
1260
1261
|
});
|
|
1261
|
-
test.serial
|
|
1262
|
+
avaRetry(test.serial, 'verify VO weak key GC faceted', async t => {
|
|
1262
1263
|
await voWeakKeyGCTest(t, true);
|
|
1263
1264
|
});
|
|
1264
1265
|
|
|
1265
1266
|
// prettier-ignore
|
|
1266
|
-
test.serial
|
|
1267
|
+
avaRetry(test.serial, 'verify presence weak key GC', async t => {
|
|
1267
1268
|
const { v, dispatchMessageSuccessfully, dispatchRetireImports, testHooks } =
|
|
1268
1269
|
await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
1269
1270
|
const vref = 'o-5';
|
|
@@ -1314,7 +1315,7 @@ test.serial('verify presence weak key GC', async t => {
|
|
|
1314
1315
|
// designate references to a non-VO.
|
|
1315
1316
|
|
|
1316
1317
|
// prettier-ignore
|
|
1317
|
-
test.serial
|
|
1318
|
+
avaRetry(test.serial, 'VO holding non-VO', async t => {
|
|
1318
1319
|
const { v, dispatchMessageSuccessfully, dispatchDropExports, dispatchRetireExports } =
|
|
1319
1320
|
await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
|
|
1320
1321
|
const { fakestore } = v;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import test from 'ava';
|
|
2
|
-
import '@endo/init/debug.js';
|
|
3
3
|
|
|
4
|
+
import { kser, kslot } from '@agoric/kmarshal';
|
|
4
5
|
import {
|
|
5
6
|
makeFakeVirtualObjectManager,
|
|
6
7
|
makeFakeVirtualStuff,
|
|
7
8
|
} from '../../tools/fakeVirtualSupport.js';
|
|
8
9
|
|
|
9
|
-
import { kser, kslot } from '../kmarshal.js';
|
|
10
10
|
import { vstr } from '../util.js';
|
|
11
11
|
|
|
12
12
|
function initThing(label = 'thing', counter = 0) {
|
|
@@ -127,6 +127,7 @@ test('multifaceted virtual objects', t => {
|
|
|
127
127
|
|
|
128
128
|
flushStateCache();
|
|
129
129
|
t.deepEqual(log.splice(0), [
|
|
130
|
+
`get idCounters => undefined`,
|
|
130
131
|
`get kindIDID => undefined`,
|
|
131
132
|
`set kindIDID 1`,
|
|
132
133
|
`set vom.vkind.2.descriptor {"kindID":"2","tag":"multithing"}`,
|
|
@@ -202,6 +203,7 @@ test('virtual object operations', t => {
|
|
|
202
203
|
// t3-0: 'thing-3' 200 0
|
|
203
204
|
const thing4 = makeThing('thing-4', 300); // [t4-0* t3-0* t2-0* t1-0*]
|
|
204
205
|
// t4-0: 'thing-4' 300 0
|
|
206
|
+
t.is(log.shift(), `get idCounters => undefined`);
|
|
205
207
|
t.is(log.shift(), `get kindIDID => undefined`);
|
|
206
208
|
t.is(log.shift(), `set kindIDID 1`);
|
|
207
209
|
t.is(log.shift(), `set vom.vkind.2.descriptor {"kindID":"2","tag":"thing"}`);
|
|
@@ -466,6 +468,7 @@ test('symbol named methods', t => {
|
|
|
466
468
|
// t1-0: 'thing-1' 0 0
|
|
467
469
|
const thing2 = makeThing('thing-2', 100); // [t1-0* t2-0*]
|
|
468
470
|
// t2-0: 'thing-2' 100 0
|
|
471
|
+
t.is(log.shift(), `get idCounters => undefined`);
|
|
469
472
|
t.is(log.shift(), `get kindIDID => undefined`);
|
|
470
473
|
t.is(log.shift(), `set kindIDID 1`);
|
|
471
474
|
t.is(
|
|
@@ -587,12 +590,12 @@ test('durable kind IDs can be reanimated', t => {
|
|
|
587
590
|
|
|
588
591
|
// Store it in the store without having used it
|
|
589
592
|
placeToPutIt.init('savedKindID', kindHandle);
|
|
590
|
-
t.is(log.shift(), 'get vc.
|
|
593
|
+
t.is(log.shift(), 'get vc.3.ssavedKindID => undefined');
|
|
591
594
|
t.is(log.shift(), `get vom.rc.${khid} => undefined`);
|
|
592
595
|
t.is(log.shift(), `set vom.rc.${khid} 1`);
|
|
593
|
-
t.is(log.shift(), `set vc.
|
|
594
|
-
t.is(log.shift(), 'get vc.
|
|
595
|
-
t.is(log.shift(), 'set vc.
|
|
596
|
+
t.is(log.shift(), `set vc.3.ssavedKindID ${vstr(kind)}`);
|
|
597
|
+
t.is(log.shift(), 'get vc.3.|entryCount => 0');
|
|
598
|
+
t.is(log.shift(), 'set vc.3.|entryCount 1');
|
|
596
599
|
t.deepEqual(log, []);
|
|
597
600
|
|
|
598
601
|
// Forget its Representative
|
|
@@ -606,7 +609,7 @@ test('durable kind IDs can be reanimated', t => {
|
|
|
606
609
|
|
|
607
610
|
// Fetch it from the store, which should reanimate it
|
|
608
611
|
const fetchedKindID = placeToPutIt.get('savedKindID');
|
|
609
|
-
t.is(log.shift(), `get vc.
|
|
612
|
+
t.is(log.shift(), `get vc.3.ssavedKindID => ${vstr(kind)}`);
|
|
610
613
|
t.is(
|
|
611
614
|
log.shift(),
|
|
612
615
|
'get vom.dkind.10.descriptor => {"kindID":"10","tag":"testkind"}',
|
|
@@ -646,6 +649,7 @@ test('virtual object gc', t => {
|
|
|
646
649
|
},
|
|
647
650
|
});
|
|
648
651
|
|
|
652
|
+
t.is(log.shift(), `get idCounters => undefined`);
|
|
649
653
|
t.is(log.shift(), `get kindIDID => undefined`);
|
|
650
654
|
t.is(log.shift(), `set kindIDID 1`);
|
|
651
655
|
const skit = [
|
|
@@ -654,9 +658,21 @@ test('virtual object gc', t => {
|
|
|
654
658
|
];
|
|
655
659
|
t.is(log.shift(), `get storeKindIDTable => undefined`);
|
|
656
660
|
t.is(log.shift(), `set ${skit[0]} ${skit[1]}`);
|
|
661
|
+
t.is(log.shift(), 'get watcherTableID => undefined');
|
|
662
|
+
t.is(log.shift(), 'set vc.1.|nextOrdinal 1');
|
|
663
|
+
t.is(log.shift(), 'set vc.1.|entryCount 0');
|
|
664
|
+
t.is(log.shift(), 'set watcherTableID o+d6/1');
|
|
665
|
+
t.is(log.shift(), 'get vom.rc.o+d6/1 => undefined');
|
|
666
|
+
t.is(log.shift(), 'set vom.rc.o+d6/1 1');
|
|
667
|
+
t.is(log.shift(), 'get watchedPromiseTableID => undefined');
|
|
668
|
+
t.is(log.shift(), 'set vc.2.|nextOrdinal 1');
|
|
669
|
+
t.is(log.shift(), 'set vc.2.|entryCount 0');
|
|
670
|
+
t.is(log.shift(), 'set watchedPromiseTableID o+d6/2');
|
|
671
|
+
t.is(log.shift(), 'get vom.rc.o+d6/2 => undefined');
|
|
672
|
+
t.is(log.shift(), 'set vom.rc.o+d6/2 1');
|
|
657
673
|
t.is(
|
|
658
674
|
log.shift(),
|
|
659
|
-
|
|
675
|
+
'set vom.vkind.10.descriptor {"kindID":"10","tag":"thing"}',
|
|
660
676
|
);
|
|
661
677
|
t.is(log.shift(), `set vom.vkind.11.descriptor {"kindID":"11","tag":"ref"}`);
|
|
662
678
|
t.deepEqual(log, []);
|
|
@@ -682,6 +698,10 @@ test('virtual object gc', t => {
|
|
|
682
698
|
t.deepEqual(dumpStore(), [
|
|
683
699
|
['kindIDID', '1'],
|
|
684
700
|
skit,
|
|
701
|
+
['vc.1.|entryCount', '0'],
|
|
702
|
+
['vc.1.|nextOrdinal', '1'],
|
|
703
|
+
['vc.2.|entryCount', '0'],
|
|
704
|
+
['vc.2.|nextOrdinal', '1'],
|
|
685
705
|
[`vom.${tbase}/1`, minThing('thing #1')],
|
|
686
706
|
[`vom.${tbase}/2`, minThing('thing #2')],
|
|
687
707
|
[`vom.${tbase}/3`, minThing('thing #3')],
|
|
@@ -691,8 +711,12 @@ test('virtual object gc', t => {
|
|
|
691
711
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
692
712
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
693
713
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
714
|
+
['vom.rc.o+d6/1', '1'],
|
|
715
|
+
['vom.rc.o+d6/2', '1'],
|
|
694
716
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
695
717
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
718
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
719
|
+
['watcherTableID', 'o+d6/1'],
|
|
696
720
|
]);
|
|
697
721
|
|
|
698
722
|
// This is what the finalizer would do if the local reference was dropped and GC'd
|
|
@@ -718,6 +742,10 @@ test('virtual object gc', t => {
|
|
|
718
742
|
t.deepEqual(dumpStore(), [
|
|
719
743
|
['kindIDID', '1'],
|
|
720
744
|
skit,
|
|
745
|
+
['vc.1.|entryCount', '0'],
|
|
746
|
+
['vc.1.|nextOrdinal', '1'],
|
|
747
|
+
['vc.2.|entryCount', '0'],
|
|
748
|
+
['vc.2.|nextOrdinal', '1'],
|
|
721
749
|
[`vom.es.${tbase}/1`, 'r'],
|
|
722
750
|
[`vom.${tbase}/1`, minThing('thing #1')],
|
|
723
751
|
[`vom.${tbase}/2`, minThing('thing #2')],
|
|
@@ -728,8 +756,12 @@ test('virtual object gc', t => {
|
|
|
728
756
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
729
757
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
730
758
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
759
|
+
['vom.rc.o+d6/1', '1'],
|
|
760
|
+
['vom.rc.o+d6/2', '1'],
|
|
731
761
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
732
762
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
763
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
764
|
+
['watcherTableID', 'o+d6/1'],
|
|
733
765
|
]);
|
|
734
766
|
|
|
735
767
|
// drop export -- should delete
|
|
@@ -759,6 +791,10 @@ test('virtual object gc', t => {
|
|
|
759
791
|
t.deepEqual(dumpStore(), [
|
|
760
792
|
['kindIDID', '1'],
|
|
761
793
|
skit,
|
|
794
|
+
['vc.1.|entryCount', '0'],
|
|
795
|
+
['vc.1.|nextOrdinal', '1'],
|
|
796
|
+
['vc.2.|entryCount', '0'],
|
|
797
|
+
['vc.2.|nextOrdinal', '1'],
|
|
762
798
|
[`vom.${tbase}/2`, minThing('thing #2')],
|
|
763
799
|
[`vom.${tbase}/3`, minThing('thing #3')],
|
|
764
800
|
[`vom.${tbase}/4`, minThing('thing #4')],
|
|
@@ -767,8 +803,12 @@ test('virtual object gc', t => {
|
|
|
767
803
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
768
804
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
769
805
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
806
|
+
['vom.rc.o+d6/1', '1'],
|
|
807
|
+
['vom.rc.o+d6/2', '1'],
|
|
770
808
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
771
809
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
810
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
811
|
+
['watcherTableID', 'o+d6/1'],
|
|
772
812
|
]);
|
|
773
813
|
|
|
774
814
|
// case 2: export, drop export, drop local ref
|
|
@@ -786,6 +826,10 @@ test('virtual object gc', t => {
|
|
|
786
826
|
t.deepEqual(dumpStore(), [
|
|
787
827
|
['kindIDID', '1'],
|
|
788
828
|
skit,
|
|
829
|
+
['vc.1.|entryCount', '0'],
|
|
830
|
+
['vc.1.|nextOrdinal', '1'],
|
|
831
|
+
['vc.2.|entryCount', '0'],
|
|
832
|
+
['vc.2.|nextOrdinal', '1'],
|
|
789
833
|
[`vom.es.${tbase}/2`, 's'],
|
|
790
834
|
[`vom.${tbase}/2`, minThing('thing #2')],
|
|
791
835
|
[`vom.${tbase}/3`, minThing('thing #3')],
|
|
@@ -795,8 +839,12 @@ test('virtual object gc', t => {
|
|
|
795
839
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
796
840
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
797
841
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
842
|
+
['vom.rc.o+d6/1', '1'],
|
|
843
|
+
['vom.rc.o+d6/2', '1'],
|
|
798
844
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
799
845
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
846
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
847
|
+
['watcherTableID', 'o+d6/1'],
|
|
800
848
|
]);
|
|
801
849
|
|
|
802
850
|
// drop local ref -- should delete
|
|
@@ -817,6 +865,10 @@ test('virtual object gc', t => {
|
|
|
817
865
|
t.deepEqual(dumpStore(), [
|
|
818
866
|
['kindIDID', '1'],
|
|
819
867
|
skit,
|
|
868
|
+
['vc.1.|entryCount', '0'],
|
|
869
|
+
['vc.1.|nextOrdinal', '1'],
|
|
870
|
+
['vc.2.|entryCount', '0'],
|
|
871
|
+
['vc.2.|nextOrdinal', '1'],
|
|
820
872
|
[`vom.${tbase}/3`, minThing('thing #3')],
|
|
821
873
|
[`vom.${tbase}/4`, minThing('thing #4')],
|
|
822
874
|
[`vom.${tbase}/5`, minThing('thing #5')],
|
|
@@ -824,8 +876,12 @@ test('virtual object gc', t => {
|
|
|
824
876
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
825
877
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
826
878
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
879
|
+
['vom.rc.o+d6/1', '1'],
|
|
880
|
+
['vom.rc.o+d6/2', '1'],
|
|
827
881
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
828
882
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
883
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
884
|
+
['watcherTableID', 'o+d6/1'],
|
|
829
885
|
]);
|
|
830
886
|
|
|
831
887
|
// case 3: drop local ref with no prior export
|
|
@@ -847,14 +903,22 @@ test('virtual object gc', t => {
|
|
|
847
903
|
t.deepEqual(dumpStore(), [
|
|
848
904
|
['kindIDID', '1'],
|
|
849
905
|
skit,
|
|
906
|
+
['vc.1.|entryCount', '0'],
|
|
907
|
+
['vc.1.|nextOrdinal', '1'],
|
|
908
|
+
['vc.2.|entryCount', '0'],
|
|
909
|
+
['vc.2.|nextOrdinal', '1'],
|
|
850
910
|
[`vom.${tbase}/4`, minThing('thing #4')],
|
|
851
911
|
[`vom.${tbase}/5`, minThing('thing #5')],
|
|
852
912
|
[`vom.${tbase}/6`, minThing('thing #6')],
|
|
853
913
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
854
914
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
855
915
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
916
|
+
['vom.rc.o+d6/1', '1'],
|
|
917
|
+
['vom.rc.o+d6/2', '1'],
|
|
856
918
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
857
919
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
920
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
921
|
+
['watcherTableID', 'o+d6/1'],
|
|
858
922
|
]);
|
|
859
923
|
|
|
860
924
|
// case 4: ref virtually, export, drop local ref, drop export
|
|
@@ -867,15 +931,23 @@ test('virtual object gc', t => {
|
|
|
867
931
|
t.deepEqual(dumpStore(), [
|
|
868
932
|
['kindIDID', '1'],
|
|
869
933
|
skit,
|
|
934
|
+
['vc.1.|entryCount', '0'],
|
|
935
|
+
['vc.1.|nextOrdinal', '1'],
|
|
936
|
+
['vc.2.|entryCount', '0'],
|
|
937
|
+
['vc.2.|nextOrdinal', '1'],
|
|
870
938
|
[`vom.${tbase}/4`, minThing('thing #4')],
|
|
871
939
|
[`vom.${tbase}/5`, minThing('thing #5')],
|
|
872
940
|
[`vom.${tbase}/6`, minThing('thing #6')],
|
|
873
941
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
874
942
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
875
943
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
944
|
+
['vom.rc.o+d6/1', '1'],
|
|
945
|
+
['vom.rc.o+d6/2', '1'],
|
|
876
946
|
[`vom.rc.${tbase}/4`, '1'],
|
|
877
947
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
878
948
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
949
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
950
|
+
['watcherTableID', 'o+d6/1'],
|
|
879
951
|
]);
|
|
880
952
|
// export
|
|
881
953
|
setExportStatus(`${tbase}/4`, 'reachable');
|
|
@@ -909,6 +981,10 @@ test('virtual object gc', t => {
|
|
|
909
981
|
t.deepEqual(dumpStore(), [
|
|
910
982
|
['kindIDID', '1'],
|
|
911
983
|
skit,
|
|
984
|
+
['vc.1.|entryCount', '0'],
|
|
985
|
+
['vc.1.|nextOrdinal', '1'],
|
|
986
|
+
['vc.2.|entryCount', '0'],
|
|
987
|
+
['vc.2.|nextOrdinal', '1'],
|
|
912
988
|
[`vom.es.${tbase}/4`, 's'],
|
|
913
989
|
[`vom.es.${tbase}/5`, 'r'],
|
|
914
990
|
[`vom.${tbase}/4`, minThing('thing #4')],
|
|
@@ -917,10 +993,14 @@ test('virtual object gc', t => {
|
|
|
917
993
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
918
994
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
919
995
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
996
|
+
['vom.rc.o+d6/1', '1'],
|
|
997
|
+
['vom.rc.o+d6/2', '1'],
|
|
920
998
|
[`vom.rc.${tbase}/4`, '1'],
|
|
921
999
|
[`vom.rc.${tbase}/5`, '1'],
|
|
922
1000
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
923
1001
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
1002
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
1003
|
+
['watcherTableID', 'o+d6/1'],
|
|
924
1004
|
]);
|
|
925
1005
|
// drop local ref -- should not delete because ref'd virtually AND exported
|
|
926
1006
|
pretendGC(`${tbase}/5`, false);
|
|
@@ -944,6 +1024,10 @@ test('virtual object gc', t => {
|
|
|
944
1024
|
t.deepEqual(dumpStore(), [
|
|
945
1025
|
['kindIDID', '1'],
|
|
946
1026
|
skit,
|
|
1027
|
+
['vc.1.|entryCount', '0'],
|
|
1028
|
+
['vc.1.|nextOrdinal', '1'],
|
|
1029
|
+
['vc.2.|entryCount', '0'],
|
|
1030
|
+
['vc.2.|nextOrdinal', '1'],
|
|
947
1031
|
[`vom.es.${tbase}/4`, 's'],
|
|
948
1032
|
[`vom.es.${tbase}/5`, 's'],
|
|
949
1033
|
[`vom.${tbase}/4`, minThing('thing #4')],
|
|
@@ -952,11 +1036,15 @@ test('virtual object gc', t => {
|
|
|
952
1036
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
953
1037
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
954
1038
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
1039
|
+
['vom.rc.o+d6/1', '1'],
|
|
1040
|
+
['vom.rc.o+d6/2', '1'],
|
|
955
1041
|
[`vom.rc.${tbase}/4`, '1'],
|
|
956
1042
|
[`vom.rc.${tbase}/5`, '1'],
|
|
957
1043
|
[`vom.rc.${tbase}/6`, '1'],
|
|
958
1044
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
959
1045
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
1046
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
1047
|
+
['watcherTableID', 'o+d6/1'],
|
|
960
1048
|
]);
|
|
961
1049
|
// drop local ref -- should not delete because ref'd virtually
|
|
962
1050
|
pretendGC(`${tbase}/6`, false);
|
|
@@ -966,6 +1054,10 @@ test('virtual object gc', t => {
|
|
|
966
1054
|
t.deepEqual(dumpStore(), [
|
|
967
1055
|
['kindIDID', '1'],
|
|
968
1056
|
skit,
|
|
1057
|
+
['vc.1.|entryCount', '0'],
|
|
1058
|
+
['vc.1.|nextOrdinal', '1'],
|
|
1059
|
+
['vc.2.|entryCount', '0'],
|
|
1060
|
+
['vc.2.|nextOrdinal', '1'],
|
|
969
1061
|
[`vom.es.${tbase}/4`, 's'],
|
|
970
1062
|
[`vom.es.${tbase}/5`, 's'],
|
|
971
1063
|
[`vom.${tbase}/4`, minThing('thing #4')],
|
|
@@ -974,11 +1066,15 @@ test('virtual object gc', t => {
|
|
|
974
1066
|
[`vom.${tbase}/7`, minThing('thing #7')],
|
|
975
1067
|
[`vom.${tbase}/8`, minThing('thing #8')],
|
|
976
1068
|
[`vom.${tbase}/9`, minThing('thing #9')],
|
|
1069
|
+
['vom.rc.o+d6/1', '1'],
|
|
1070
|
+
['vom.rc.o+d6/2', '1'],
|
|
977
1071
|
[`vom.rc.${tbase}/4`, '1'],
|
|
978
1072
|
[`vom.rc.${tbase}/5`, '1'],
|
|
979
1073
|
[`vom.rc.${tbase}/6`, '1'],
|
|
980
1074
|
['vom.vkind.10.descriptor', '{"kindID":"10","tag":"thing"}'],
|
|
981
1075
|
['vom.vkind.11.descriptor', '{"kindID":"11","tag":"ref"}'],
|
|
1076
|
+
['watchedPromiseTableID', 'o+d6/2'],
|
|
1077
|
+
['watcherTableID', 'o+d6/1'],
|
|
982
1078
|
]);
|
|
983
1079
|
});
|
|
984
1080
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
2
|
import test from 'ava';
|
|
3
|
-
import '@endo/init/debug.js';
|
|
4
3
|
|
|
5
4
|
import { Far } from '@endo/marshal';
|
|
6
|
-
import { kser, kunser } from '
|
|
5
|
+
import { kser, kunser } from '@agoric/kmarshal';
|
|
7
6
|
import { setupTestLiveslots } from '../liveslots-helpers.js';
|
|
7
|
+
import { watchCollected } from '../gc-and-finalize.js';
|
|
8
8
|
|
|
9
9
|
test('virtual object state writes', async t => {
|
|
10
|
-
let
|
|
10
|
+
let collected;
|
|
11
11
|
|
|
12
12
|
const initData = { begin: 'ning' };
|
|
13
13
|
const initStateData = { begin: kser(initData.begin) };
|
|
@@ -23,11 +23,11 @@ test('virtual object state writes', async t => {
|
|
|
23
23
|
const root = Far('root', {
|
|
24
24
|
make: () => {
|
|
25
25
|
const thing = makeThing();
|
|
26
|
-
|
|
26
|
+
collected = watchCollected(thing);
|
|
27
27
|
return thing;
|
|
28
28
|
},
|
|
29
29
|
ping: thing => {
|
|
30
|
-
|
|
30
|
+
collected = watchCollected(thing);
|
|
31
31
|
return thing.ping();
|
|
32
32
|
},
|
|
33
33
|
});
|
|
@@ -56,7 +56,7 @@ test('virtual object state writes', async t => {
|
|
|
56
56
|
|
|
57
57
|
// 'thing' is exported, but not held in RAM, so the Representative
|
|
58
58
|
// should be dropped
|
|
59
|
-
t.
|
|
59
|
+
t.true(collected.result);
|
|
60
60
|
|
|
61
61
|
// Invoking a method, on the other hand, *does* require creation of
|
|
62
62
|
// "state" and "context", and creation of "state" requires reading
|
|
@@ -70,5 +70,5 @@ test('virtual object state writes', async t => {
|
|
|
70
70
|
|
|
71
71
|
// 'thing' is again dropped by RAM, so it should be dropped. If
|
|
72
72
|
// "context" were erroneously retained, it would stick around.
|
|
73
|
-
t.
|
|
73
|
+
t.true(collected.result);
|
|
74
74
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
|
-
import '@endo/init/debug.js';
|
|
3
2
|
|
|
4
3
|
import { makeFakeVirtualObjectManager } from '../../tools/fakeVirtualSupport.js';
|
|
5
4
|
|
|
6
|
-
test('weakMap vref handling',
|
|
5
|
+
test('weakMap vref handling', t => {
|
|
7
6
|
const log = [];
|
|
8
7
|
const {
|
|
9
8
|
VirtualObjectAwareWeakMap,
|