Skip to content

Issues with boolean serialization #132

@FiV0

Description

@FiV0

The test that illustrates this issue is the following (and adapted version of the first map-test)

(testing "bad map-fn serialization"
    (let [p (sut/make-pipeline [])
          input (-> [{:a 1} {:b 2} {:c 3}]
                    (sut/generate-input p))
          my-bool false
          rslt (sut/map (fn [x]
                          (if my-bool
                            x
                            {:random :value}))
                        {:name :map-w-sys
                         :initialize-fn (fn [] {:init 10})}
                        input)]

      (is (str/starts-with? (.getName rslt) "map-w-sys"))
      (is (-> (PAssert/that rslt)
              (.containsInAnyOrder [{:a 1 }
                                    {:b 2 }
                                    {:c 3 }])))

      (sut/wait-pipeline-result (sut/run-pipeline p))))

This test currently passes on master (it shouldn't). The problem seems to be the my-bool serialization. Replacing it with a literal value of false in the map fn makes the test fail (as expected).

I think the problem has to do with the anonymous fn serialization. my-bool is out scope when deserialized and executed on some worker. The question is how we should deal with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions