question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception in ThreadLocalRandom.nextInt()

See original GitHub issue

안녕하세요! 사내 라이브러리로 AutoParams를 사용하고 있다가 아래 에러를 발견해 이슈 남깁니다. 혹시 더 자세한 정보가 필요하다면 말씀 부탁드려요. 감사합니다.


버전: AutoParams 0.2.3, (0.3.0에서도 발생)

Error message:

Test_<TEST_NAME>.initializationError FAILED
    java.lang.IllegalArgumentException at ThreadLocalRandom.java:337

ThreadLocalRandom.java:337 의 Exception은 아래에서 설명하는 Exception입니다. https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadLocalRandom.html#nextInt-int-int-

테스트 코드는 @AutoSource 어노테이션 사용 중이고, 사용하는 데이터 타입은 오브젝트 타입이며 Long, OffsetDateTime, String 등을 포함하고 있습니다.

에러 발생 환경:

  • Github Action 서버
  • ubuntu-latest
  • JDK 11
  • Gradle 7.2, 6.3 둘다 발생
  • 항상 에러가 발생하지 않고, 가끔 발생했습니다.

~아래와 같이 설정한 로컬 머신에서는 재현되지 않았습니다~ 여러번 하니 재현되었습니다.

  • Mac
  • JDK 11
  • Gradle 6.7

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gyuwoncommented, Oct 22, 2021
1reaction
33577commented, Sep 24, 2021

확인 감사드립니다! 현재는 아래 정도로 밖에 안 나오는데 더 자세히 출력하도록 하고 재현해서 추가하겠습니다!

Test_<TEST_NAME>.initializationError FAILED
    java.lang.IllegalArgumentException at ThreadLocalRandom.java:337
Read more comments on GitHub >

github_iconTop Results From Across the Web

Java ThreadLocalRandom nextInt() Method with Examples
The nextInt() method of Java ThreadLocalRandom class returns a pseudorandom int value. This method overrides the nextInt in class Random.
Read more >
ThreadLocalRandom (Java Platform SE 8 ) - Oracle Help Center
Class ThreadLocalRandom ; double, nextDouble(). Returns a pseudorandom double value between zero (inclusive) and one (exclusive). ; int, nextInt(). Returns a ...
Read more >
Guide to ThreadLocalRandom in Java - Baeldung
Here's an example of generating a random int value between 0 and 100: int boundedRandomValue = ThreadLocalRandom.current().nextInt(0, 100);
Read more >
java.util.concurrent.ThreadLocalRandom.nextInt ... - Tabnine
How to use. nextInt. method. in. java.util.concurrent.ThreadLocalRandom ... public static byte[] computeMultipartBoundary() { ThreadLocalRandom random ...
Read more >
java - Why do I always get the same result when using a ...
Storing the result of ThreadLocalRandom.current() in the constructor in an instance variable of a class is a bad idea.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found