Code review comment for ~canonical-kernel-team/+git/autotest-client-tests:ubuntu_stress_smoke_split_test

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

> Ok, i moved the swap on / oom part into a separate script
> (ubuntu_stress_smoke_test_init.sh) and i'm executing it in the initializate()
> method, but now i noticed that initialize() is called every time run_once() is
> invoked (thus creating a swap file every time a single test is run): wasn't
> that supposed to run just at the start of autotest?

Hi Paolo,
yes you're right! I just noticed that I got confused by the ubuntu_lttng_smoke_test which only has just one single test in the control file.

The initalize() method is indeed being called EVERY TIME when the test is started. So the actual workflow is like this:
1. initialize()
2. setup()
3. run_once() with stressors
4. initialize()
5. run_once()

From the document [1]:
initialize() - This is run before everything, every time the test is run.

[1] https://github.com/autotest/autotest/blob/0862aa74389bf434533697a9d970cf91e03b09ce/documentation/source/main/local/AddingTest.rst#L32

« Back to merge proposal