-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Dump logs on failing devicelab test to recipe artifact location #74378
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
Conversation
9db8864 to
faeb23f
Compare
|
Logs show it writing files to the @godofredoc Is there more needed to get this working than the recipe change? [Edit: I know the recipe change was reverted, we can look once it re-lands] |
|
I think this is working (it found the |
Here is a task execution using this PR and my updates to the recipes: https://chromium-swarm.appspot.com/task?id=5145de6679dca410 please take a look. |
|
It sure looks like it's working @godofredoc! I'm going to get rid of the simulator system log collection, seems like it'll be a lot of noise, though it was a good test. |
|
@godofredoc I can't figure out that UI, how can I see this PR, your updates to the recipe, and the |
17cc4b4 to
2b1f961
Compare
jonahwilliams
left a comment
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 don't really have the context to review this, but happy to see more logs being made available :)
|
(that said, if you wanted to GVC real quick and walk me through it, that might help) |
I expanded on the description a bit for context. Essentially, it's finding the |
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.
Is there a risk of us dumping old logs on a particular test with this sort of host based structure?
i.e. an agent runs a simulator task, then crashes running a physical ios test. The dumped logs include both combined.
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.
or I guess this could happen from the same agent - do these logs get cleaned up?
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.
Me:
Does this directory need to be removed after upload so the logs don't bleed between tests?
The good news is that directory is the in the api.path['cleanup'] which luci cleans up automatically after the task execution.
As for these particular simulator logs, they actually aren't cleaned up between tests, so we'd need to correlate timestamps. For example, the example task execution at started at Jan 22 18:26 but shows simulator logs from Jan 17 18:08:47 (I've since removed the system.log files from upload, but it does upload app crashes from the simulator on task failure). I can file a recipe issue to remove this directory before the Xcode select step, but I don't think this test runner code should worry about that.
However if we say uploaded a adb logcat with a timestamp of the beginning of the test and saved it to the directory, it would be cleaned up after task execution and wouldn't be present in any other tasks.
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.
something, something great minds.
I'd be concerned about leaving all of the responsibility of deleting old logs (outside of the upload dir) to the recipes. If someone less familiar with our CI system (most of us) wants to add new logs, then they would also need to know the change the recipe in the right way.
Checking timestamps here seems like a reasonable approach. And yeah, if logs come through adb with a timestamp start they should be fairly up to date.
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.
If someone less familiar with our CI system (most of us) wants to add new logs, then they would also need to know the change the recipe in the right way.
I hope that would be rare and these artifacts would be more transient, like screenshots, or device log dumps, or IDE test logs, or size analysis files. We could push more of that stuff into this upload directory instead of dumping it all into the task stdout as we do now. I just happened to think of simulator app crashes first, and I had hoped they would be cleaned up between Xcode installs, but I guess not.
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.
what I would like is for this to fail in a way that doesn't upload logs/files instead of uploading old logs/files, because the former is much easier to notice immediately
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.
Are those logs generated in deriveddata? if yes, deriveddata is cleaned up before running every task.
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.
Are those logs generated in deriveddata? if yes, deriveddata is cleaned up before running every task.
Unfortunately not.
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 has been removed.
I relanded the change a few hours ago, let me re-trigger the all the build in this PR to see the output. |
2b1f961 to
ae9fff7
Compare
|
I narrowed the scope of this change. I removed the platform implementations of I can add more things we find useful in future PRs. |
|
Ready for re-review, @jonahwilliams |
jonahwilliams
left a comment
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.
LGTM

Upload test logs for LUCI tests.
HostAgent.dumpDirectorydefaults to envFLUTTER_LOGS_DIRwhich is a path set up in the LUCI recipe which will be uploaded to GCS and viewable in the test run UI (https://flutter-review.googlesource.com/c/recipes/+/9944):Fallback to a tmp directory when
FLUTTER_LOGS_DIRenv does not exist (like when run locally).As a proof-of-concept, use the new
HostAgent.dumpDirectoryin a test. Persistmodule_test_iosXCUITest results (This would have helped with test failures like #70630).Future work
Add
dumpmethod to theDeviceclass to collect additional logs, to be called on test failures for connected devices. For example,AndroidDevice.dump()could uploadabd dumpsys meminfo,abd dumpsys procstats, etc to the uploaded directory.#74344