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

testing/monkey: add running-minutes parameter #2930

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

jialuxiao-mi
Copy link
Contributor

Summary

Add runtime control to exit Monkey after a specified amount of time.

Impact

Monkey test.

Testing

TESTING_MONKEY=y

Example of using the --running-minutes parameter: Monkey testing ends after ten minutes.

monkey -t 11 --running-minutes 10

@nuttxpr
Copy link

nuttxpr commented Jan 7, 2025

[Experimental Bot, please feedback here]

This PR description does not fully meet the NuttX requirements. Here's why and how to fix it:

Missing Information in Summary:

  • Why is this change necessary? The description only states "Add runtime control...". Explain the benefit – e.g., "Currently, Monkey runs indefinitely, making automated testing difficult. This change allows specifying a runtime, enabling integration into automated test suites."
  • What functional part of the code is being changed? Specify the affected files/modules (e.g., apps/examples/monkey).
  • How does the change exactly work? Briefly describe the implementation (e.g., "Added a command-line argument --running-minutes which is parsed and used to set a timer. Monkey exits when the timer expires.").

Missing Information in Impact:

While "Monkey test" is mentioned, it's too vague. Address all impact points explicitly with "YES" or "NO" and provide details where necessary:

  • Is new feature added? YES (runtime control for Monkey)
  • Is existing feature changed? NO (unless the existing behavior is also modified)
  • Impact on user: YES (Users can now use the --running-minutes option).
  • Impact on build: NO (unless you added new build dependencies or configurations).
  • Impact on hardware: NO (unless it affects hardware-specific functionality).
  • Impact on documentation: YES (The documentation needs to be updated to describe the new --running-minutes option). Mention where you made or will make documentation changes.
  • Impact on security: NO (unless the change introduces any potential security vulnerabilities).
  • Impact on compatibility: NO (unless this breaks existing scripts or tools relying on Monkey's previous behavior).

Missing Information in Testing:

  • Build Host(s): Provide details about your build environment. Example: "Linux, x86_64, GCC 9.4.0"
  • Target(s): Specify the target architecture and board/configuration used for testing. Example: "sim:qemu-x86_64", "arm:stm32f4discovery:nsh"
  • Testing logs before change: Include relevant logs demonstrating the previous behavior (e.g., Monkey running indefinitely). Even a simple "Monkey runs continuously until manually stopped" would be better than nothing.
  • Testing logs after change: The current log only shows the command, not the output. Include logs showing Monkey exiting after 10 minutes. Even a simple timeline like "Started Monkey at [time]. Monkey exited at [time, approximately 10 minutes later]" would be helpful.

Example of a better PR description:

## Summary

This change adds runtime control to the Monkey test application, allowing users to specify a duration after which the test will automatically terminate. This is necessary to facilitate automated testing, as Monkey currently runs indefinitely.  The change modifies the `apps/examples/monkey` application. A new command-line argument `--running-minutes` has been added. This argument is parsed, and a timer is set to terminate Monkey after the specified duration.

## Impact

* Is new feature added? YES (Runtime control for Monkey using the `--running-minutes` option).
* Is existing feature changed? NO
* Impact on user: YES (Users can now specify the `--running-minutes` option to control test duration).
* Impact on build: NO
* Impact on hardware: NO
* Impact on documentation: YES (The documentation in `apps/examples/monkey/README.md` will be updated to describe the new `--running-minutes` option).
* Impact on security: NO
* Impact on compatibility: NO


## Testing

I confirm that changes are verified on local setup and works as intended:
* Build Host(s): Linux, x86_64, GCC 11.2.0
* Target(s): sim:qemu-x86_64

Testing logs before change:

Monkey runs continuously until manually stopped (Ctrl+C).


Testing logs after change:
```bash
monkey -t 11 --running-minutes 10
# Started Monkey at 10:00 AM.
# ... (Other Monkey output)
# Monkey exited at 10:10 AM.

Remember to replace the example information with your specific details. This revised description addresses the missing points and provides more clarity about the change's purpose, implementation, and testing.

@xiaoxiang781216 xiaoxiang781216 merged commit b73adbe into apache:master Jan 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants