Skip to content

Tests do not finish if an agent has been started.Β #43

@farbeiza

Description

@farbeiza

If an agent is started, tests do not finish, waiting for the agent threads to finish:

These files should reproduce the issue:
deps.edn:

{:paths ["src"]
 :deps {}
 :aliases {:test {:extra-paths ["test"]
                  :extra-deps {io.github.cognitect-labs/test-runner {:git/sha "a522ab2851a2aa5bf9c22a942b45287a3a019310"}}
                  :main-opts ["-m" "cognitect.test-runner"]
                  :exec-fn cognitect.test-runner.api/test}}}

core_test.clj:

(ns core-test
  (:require [clojure.test :refer :all]))

(deftest duration-test
  (let [a (agent 0)]
    (send a inc)
    (await a)
    (is (= 1 @a))))

I've seen a PR which could be very useful for this: Add before and after options
since it will allow to run (shutdown-agents) after running the tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions