Skip to content

common-lib background job test is broken #2070

@jasongilman

Description

@jasongilman

Running lein test in common-lib is failing for cmr.common.test.background-jobs

It's failing with this error

FAIL in (background-jobs-test) (background_jobs.clj:26)
Start all the jobs and verify each job is called the correct number of times
expected: (<= 5 (clojure.core/deref counter2) 6)
  actual: (not (<= 5 1 6))
Exception in thread "Thread-37" java.lang.IllegalArgumentException: No matching method sleep found taking 1 args
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:154)
	at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:332)
	at cmr.common.background_jobs$create_thread_for_background_job$fn__10688.invoke(background_jobs.clj:21)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.base/java.lang.Thread.run(Thread.java:1623)
Exception in thread "Thread-36" java.lang.IllegalArgumentException: No matching method sleep found taking 1 args
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:154)
	at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:332)
	at cmr.common.background_jobs$create_thread_for_background_job$fn__10688.invoke(background_jobs.clj:21)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.base/java.lang.Thread.run(Thread.java:1623)

It looks like there's two ways to fix this by either casting the integer argument to a long or passing two arguments.

java -version
java version "1.8.0_401"
Java(TM) SE Runtime Environment (build 1.8.0_401-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.401-b10, mixed mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions