Skip to content

Commit 32d9f14

Browse files
author
i2cjak
committed
viewer_revision_state_probe: a watcher from the start
On main a result for a source no one watches is dropped with it (Src.gc), so the probe died with 'missing source' before its first stage. Client 6 now watches from the start and stops once client 7 does, leaving the clients the driver checks (7, 8, 9, 10) as they were. The probe's driver, test/tools/viewer_revision_state_test.mjs, passes.
1 parent 8263986 commit 32d9f14

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎test/native/viewer_revision_state_probe.bend‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,14 @@ def probe.checked(+stage: String, before: U32 & String, after: U32 & String, r:
9797
m : Maybe<&1, PV.PMsg> <- Chan.recv(PV.PMsg, q)
9898
probe.checked.message(m, stage)
9999

100+
# client 6 watches the source from the start (a result for a source no one
101+
# watches is dropped with it, Src.gc) and stops once client 7 watches it
100102
def main() -> IO(Unit):
101103
do IO<Unit>:
102-
a : PV.PSt <- probe.handle(PV.PSt{[PV.Src{probe.key(), 0, "/unused", 0, "", 0n, False{}, None{}, ""}], Nil{}, True{}},
104+
a : PV.PSt <- probe.handle(PV.PSt{[PV.Src{probe.key(), 0, "/unused", 0, "", 0n, False{}, None{}, ""}], [PV.Sub{6, probe.key(), Nil{}, "", False{}, ""}], True{}},
103105
PV.PGot{probe.key(), 10, "revision-A", Some{probe.model(True{})}, ""}, "success-A")
104-
watched : PV.PSt <- probe.watch(a, 7, "first-subscriber")
106+
first : PV.PSt <- probe.watch(a, 7, "first-subscriber")
107+
watched : PV.PSt <- probe.handle(first, PV.PStop{6}, "seed-gone")
105108
failed : PV.PSt <- probe.handle(watched, PV.PGot{probe.key(), 10, "revision-B", None{}, "export failed"}, "failure-B")
106109
cached : PV.PSt <- probe.watch(failed, 8, "cached-after-failure")
107110
half : PV.PSt <- probe.handle(cached, PV.PGot{probe.key(), 10, "revision-C", None{}, ""}, "half-written-C")

0 commit comments

Comments
 (0)