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

Make test_onroad stressful #34295

Open
adeebshihadeh opened this issue Dec 20, 2024 · 2 comments
Open

Make test_onroad stressful #34295

adeebshihadeh opened this issue Dec 20, 2024 · 2 comments

Comments

@adeebshihadeh
Copy link
Contributor

Now that test_onroad is reliable, it's time to add some things to really stress the system:

  • lots of disk load: openpilot shouldn't rely on a responsive disk. catches things like reading params in a real-time loop
  • change the system time: catch things like tinygrad/tinygrad@cda34cc
@adeebshihadeh adeebshihadeh changed the title test_onroad stress enhancemnets Make test_onroad stressful Dec 20, 2024
@JacksonRT
Copy link

@adeebshihadeh Would writing large files to the disk for the test duration the removing the afterward be what your looking for?

@JacksonRT
Copy link

JacksonRT commented Jan 19, 2025

@adeebshihadeh This is what I've got so far.

 def create_disk_load(file_path="temp_file.txt", file_size_mb=50000):

  for _ in range:
    while 0 <= TEST_DURATION:
      file_size_bytes = file_size_mb * 1024 * 1024
      data = os.urandom(file_size_bytes)
      #Create File and Writes/Reads its contents
      try:
        with open(file_path, "wb") as f:
          f.write(data)
        with open(file_path, "rb") as f:
          f.read()
      #Remove File afterwards
      finally:
        try:
          os.remove(file_path)
        except FileNotFoundError:
          # Ignore if the file doesn't exist
          pass

if __name__ == "__main__":
  create_disk_load()

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

No branches or pull requests

2 participants