-
Notifications
You must be signed in to change notification settings - Fork 30
Add script to run all tests that take less than 1 min each #39
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
base: main
Are you sure you want to change the base?
Add script to run all tests that take less than 1 min each #39
Conversation
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Also add a note to the README about how it seems that VirtualBox VMs can run Tofino tests faster if you reduce them to only 1 VCPU. Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
ci/run-one-test.sh
Outdated
| timeout 10800 ./run_p4_tests.sh -p ${TESTNAME} --arch tofino |& sed 's/^/tests: /' | ||
|
|
||
| echo "Killing bf_switchd and tofino-model processes ..." | ||
| sudo killall bf_switchd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break any parallel setup. I would only kill the process returned by the shell.
Python has better facilities for this imho and ChatGPt etc works really well for these kinds of boilerplate scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vgurevich Have you run multiple Tofino models and bf_switchd processes on the same base OS in parallel successfully? Without containers or VMs or other things like that to separate them from each other?
If that works, great.
I tried using bash mechanisms to capture the PID of the sudo run_*.sh runs, but killing those only killed the sudo process, not the run_*.sh script running as root, so was not effective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The existing tests that I am aware expect that a set of veth interfaces have been created first, before the test starts running, and the test assumes that whichever of those veth interfaces it wants to use, are available for its sole use.
Thus any two tests that both use veth2 will conflict with each other if you attempt to run them both without Linux network namespaces or other tricks like that.
And that is assuming that the Tofino model and driver processes don't conflict with each other in other ways besides this, which might be the case, but it seems like a trip down the rabbit hole to run parallel tests on the same system. If you really want to do testing in parallel, it would be far easier to set up and easier to maintain if you divided up the tests N ways and ran the different subsets of all tests on N different systems in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fruffy I am fairly sure it is possible to enable running multiple tests in parallel on a system, but doing so would be significantly more development time to create than what is in this PR. It isn't just replacing the uses of killall. I added comments to these trying to make it very explicit that these scripts only support running one test at a time on a system.
I added another script that runs all Tofino1 and Tofino2 tests that take at most about 5 minutes of time each, which is most of them. They take about 90 minutes to run. If I enabled all of the tests, the longest 5 or 6 would push the total up to about 5 hours. This seems like a reasonable length of test suite to run nightly or weekly, rather than pre-commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
We definitely had parallel scripts for the Tofino PTF tests using network namespaces. Which is why I was concerned about this command (if we end up using these commands it for the tests).
Also add a script that runs all Tofino1 and Tofino2 tests. Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
failing the run-one-test.sh script if that does happen. Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
| @@ -0,0 +1,318 @@ | |||
| #! /bin/bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we try to combine this with #94? I am curious to see whether we can now run tests in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a commit a moment ago to update this Bash script to use your new run-test.py program to run individual tests. We'll see how it goes.
…gerhut/open-p4studio into add-script-to-run-one-tofino1-test
…l tests Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
|
@fruffy In the logs for the ubuntu-22.04 test running in CI, you can download them and then do: Every line with The other lines with errors about Most of these tests pass on my local system. I see 11 out of 109 tests failing on my local system, vs. 107 out of 109 failing in CI. |
This PR also adds the
--verbosity DEBUGoption to CI builds, which I expect will help diagnose future CI build failures.