Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
default: ""

env:
JOLT_VERSION: ${{ inputs.jolt-version || '0.8.1' }}
JOLT_VERSION: ${{ inputs.jolt-version || '0.8.2' }}

jobs:
test:
Expand Down
9 changes: 8 additions & 1 deletion src/ebb/impl/latest.clj
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,15 @@
(step ps i))))
(or (= p (.-pending ps)) (terminated ps i))))

;; RT/iter, not (.iterator (seq fs)): `fs` is a rest arg, so a zero-input
;; (m/latest f) -- issue #126, a well defined continuous flow whose state is
;; always (f) -- hands this nil, and a method call on nil is a
;; NullPointerException. It ran only because jolt through 0.8.1 answered
;; (.iterator nil) with an empty iterator instead of refusing it
;; (jolt-lang/jolt#867); 0.8.2 refuses it as the JVM always has. RT/iter is what
;; clojure.core's own walkers use for exactly this and takes nil on both hosts.
(defn run [c fs s d]
(let [it (.iterator (seq fs))
(let [it (clojure.lang.RT/iter fs)
arity (count fs)
;; `step` starts NIL, as Latest.java's does. It is what says "this flow
;; has no value yet": `transfer` reports Uninitialized on it, and
Expand Down
5 changes: 4 additions & 1 deletion src/ebb/impl/sample.clj
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@
(if (nil? (.-notifier ps))
(throw x) x)))

;; RT/iter for the same reason latest/run uses it: `fs` here is (rest flows),
;; so (m/sample f sampler) with no continuous inputs -- the single-flow sample,
;; which nothing in the suite covered -- hands this an empty seq's nil.
(defn run [c f fs n t]
(let [it (.iterator (seq fs))
(let [it (clojure.lang.RT/iter fs)
arity (inc (count fs))
args (object-array arity)
owed (int-array arity)
Expand Down
10 changes: 10 additions & 0 deletions test/ebb/missionary_issues_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
(t/is (= [:ok [:nullary]]
(settle (m/reduce conj [] (m/latest (fn [] :nullary)))))))

(t/deftest sample-supports-a-sampler-only
;; Not an upstream issue: ebb's own. `sample` splits its varargs into the
;; sampler and the continuous inputs, so (m/sample f sampler) hands the impl
;; an EMPTY input list -- the same nil target the zero-input latest above
;; hands it, and the same NullPointerException. Nothing covered the shape,
;; so it went unreported while the latest case was being filed. The result is
;; (f) per sampled value, as it is with any other input count.
(t/is (= [:ok [[1] [2] [3]]]
(settle (m/reduce conj [] (m/sample vector (m/seed [1 2 3])))))))

(t/deftest signal-reports-an-uninitialised-flow-125
;; #125: (m/signal (m/ap (m/? m/never))) leaked internal state and reported
;; nothing. It must fail instead.
Expand Down