Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common-lib background job test is broken #2070

Open
jasongilman opened this issue Feb 29, 2024 · 1 comment
Open

common-lib background job test is broken #2070

jasongilman opened this issue Feb 29, 2024 · 1 comment

Comments

@jasongilman
Copy link
Contributor

jasongilman commented Feb 29, 2024

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)
@jasongilman
Copy link
Contributor Author

It also seems like the background jobs code isn't used anymore so I could also see getting rid of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant