Mailing List Archive

Allowing tests to use multiple cores
Hi all,

I found out last week that my concurrent HNSW [1] was not as bug-free as I
had thought. It was passing the same tests as the serial HNSW, but the
gradle configuration was limiting the test JVMs to a single core. I had a
much more interesting time debugging when I hacked out that limitation
[2]. Is there a best practice way to opt into multi-cores tests without
this blunt hammer?

[1] https://github.com/apache/lucene/pull/12254
[2]
https://github.com/apache/lucene/pull/12254/commits/e6fbf0afb7da7af49a7a4fdbc578fde0da10d162

--
Jonathan Ellis
co-founder, http://www.datastax.com
@spyced
Re: Allowing tests to use multiple cores [ In reply to ]
Hmm, I think that setting just tells the JVM to pretend the underlying
hardware has only one core? I.e. forcing
"Runtime.getRuntime().availableProcessors()"
to return 1.

But your test is still free to launch multiple threads to test concurrency
and they should run on multiple actual CPU cores if your hardware has it?

˜
Mike McCandless

http://blog.mikemccandless.com


On Tue, May 16, 2023 at 7:26?PM Jonathan Ellis <jbellis@gmail.com> wrote:

> Hi all,
>
> I found out last week that my concurrent HNSW [1] was not as bug-free as I
> had thought. It was passing the same tests as the serial HNSW, but the
> gradle configuration was limiting the test JVMs to a single core. I had a
> much more interesting time debugging when I hacked out that limitation
> [2]. Is there a best practice way to opt into multi-cores tests without
> this blunt hammer?
>
> [1] https://github.com/apache/lucene/pull/12254
> [2]
> https://github.com/apache/lucene/pull/12254/commits/e6fbf0afb7da7af49a7a4fdbc578fde0da10d162
>
> --
> Jonathan Ellis
> co-founder, http://www.datastax.com
> @spyced
>