Skip to content

Excessive printing by eftest.report.progress/report on :pass #94

@p-himik

Description

@p-himik

Just spent half a day chasing an intermittent issue where running a bunch of quick tests with 30k assertions would sometimes result in the behavior on the recording below. It would last for at least multiple minutes, whereas a normal run would take 20 seconds.

Screencast.2024-07-18.23.47.43.mp4

After experimenting with multiple changes to the code, debugging things, changing reporters, changing terminals and shells used to run the tests, I'm now 90% certain that the culprit is some rendering-related system on my end. Maybe it's the GPU driver, maybe it's the hardware, maybe X11, maybe something else.

But the issue goes away if I make this small addition to my code:

(let [orig-report (get-method eftest.report.progress/report :pass)]
  (defmethod eftest.report.progress/report :pass [m]
    (binding [clojure.test/*test-out* (java.io.StringWriter.)]
      (orig-report m))))

As a bonus, the tests now run 1-2 s faster.
Visually, there are no changes at all since the report of :pass doesn't add any new information anyway - all the information is already printed by :begin-test-run and :end-test-var.

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