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

[PATCH v5] validation: random: limit duration of some tests #2110

Merged

Conversation

JereLeppanen
Copy link
Collaborator

@JereLeppanen JereLeppanen commented Aug 28, 2024

No description provided.

@odpbuild odpbuild changed the title validation: random: shorten some tests with ARM RNG [PATCH v1] validation: random: shorten some tests with ARM RNG Aug 28, 2024
@odpbuild odpbuild changed the title [PATCH v1] validation: random: shorten some tests with ARM RNG [PATCH v2] validation: random: shorten some tests with ARM RNG Aug 28, 2024
@@ -252,6 +254,9 @@ static void random_test_frequency(odp_random_kind_t kind)
bits, chisq, cells - 1, crit, res_str(chisq < crit));

CU_ASSERT(chisq < crit);

if (odp_time_local_ns() - start > 5 * ODP_TIME_SEC_IN_NS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need 5 secs here and in the other place? Wouldn't just 1 sec be enough? That is about the point where lowering the time out does not speed up the test much more due to the constant overhead of running the test (or else I would suggest less than 1 sec timeout).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some environments, with a one second limit, we break after executing the loop just once, and that's with bits=1, which is a kind of a special case. But I don't think that matters much. In the other place one second is probably fine.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One could check if (bits > 1 && odp_time_local_ns() - start > ODP_TIME_SEC_IN_NS), but I'm fine with this version. The check can be optimized later if deemed necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time limit is one second in v3, because there's not enough reasons for a longer limit.

@psavol psavol added this to the v1.45.1.0 release milestone Aug 29, 2024
@odpbuild odpbuild changed the title [PATCH v2] validation: random: shorten some tests with ARM RNG [PATCH v3] validation: random: shorten some tests with ARM RNG Sep 2, 2024
@JereLeppanen
Copy link
Collaborator Author

v3:

  • Add three new commits.

@JereLeppanen JereLeppanen changed the title [PATCH v3] validation: random: shorten some tests with ARM RNG [PATCH v3] validation: random: limit duration of some tests Sep 2, 2024
test/performance/odp_random.c Outdated Show resolved Hide resolved
test/performance/odp_random.c Outdated Show resolved Hide resolved
test/performance/odp_random.c Outdated Show resolved Hide resolved
test/performance/odp_random.c Outdated Show resolved Hide resolved
@odpbuild odpbuild changed the title [PATCH v3] validation: random: limit duration of some tests [PATCH v4] validation: random: limit duration of some tests Sep 3, 2024
@JereLeppanen
Copy link
Collaborator Author

v4:

  • Matias' comments.

Two of the randomness tests are too slow with ARM RNG true
random. Limit the time that those tests are allowed to run. This saves
about one minute in some environments.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Rename the -t,--threads option to -c,--num_cpu, to conform to the
convention used by most of the other test programs.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
To reduce output clutter, remove an unnecessary odp_shm_print_all()
call.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Add option -t,--time, which can be used to set a target test duration
per random data type. The default is 500 msec, so the default test
duration is half a second times the number of available random data
types. This saves about half a minute in some environments.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
@odpbuild odpbuild changed the title [PATCH v4] validation: random: limit duration of some tests [PATCH v5] validation: random: limit duration of some tests Sep 3, 2024
@JereLeppanen
Copy link
Collaborator Author

v5:

  • Rebase.
  • Add review tags.

@MatiasElo MatiasElo enabled auto-merge (rebase) September 3, 2024 13:34
@MatiasElo MatiasElo merged commit 8b3b906 into OpenDataPlane:master Sep 3, 2024
170 checks passed
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

Successfully merging this pull request may close these issues.

4 participants