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

Attempt to get better logcat logging for failed tests #7816

Merged
merged 3 commits into from
Feb 23, 2023

Conversation

grendello
Copy link
Contributor

I noticed that more often than not, we don't see the actual error in
logcat-failed.log when the test fails on CI, but when it runs locally,
we can see the issue logged properly.

I'm not 100% what causes it on CI, but I suspect that we might be facing
a problem with the logcat buffer wrapping around and overwriting the
interesting data. This might be because of the fact that logcat -c
runs only once per class containing tests and also because we log
too quickly after the app quits.

To remedy the former, run logcat -c before each test starts and to
attempt a fix for the latter, pause for 1 second before dumping logcat
buffer after the test fails.

I noticed that more often than not, we don't see the actual error in
`logcat-failed.log` when the test fails on CI, but when it runs locally,
we can see the issue logged properly.

I'm not 100% what causes it on CI, but I suspect that we might be facing
a problem with the logcat buffer wrapping around and overwriting the
interesting data.  This might be because of the fact that `logcat -c`
runs only once per **class** containing tests and also because we log
too quickly after the app quits.

To remedy the former, run `logcat -c` before each test starts and to
attempt a fix for the latter, pause for 1 second before dumping logcat
buffer after the test fails.
* main:
  [build] Only build the latest API level (dotnet#7786)
  [Xamarin.Android.Build.Tasks] Improve aapt2+file not found handling (dotnet#7644)
@jonpryor jonpryor merged commit b485425 into dotnet:main Feb 23, 2023
@grendello grendello deleted the improve-logcat branch February 23, 2023 14:21
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 23, 2023
* main:
  LEGO: Merge pull request 7825
  Bump to xamarin/Java.Interop/main@bbaeda6f (dotnet#7799)
  Bump NDK to r25c (dotnet#7808)
  [Xamarin.Android.Build.Tests] Improve logcat logging in failed tests (dotnet#7816)
  [Mono.Android] Update api-compat reference file for current API-33 (dotnet#7822)
  Localized file check-in by OneLocBuild Task (dotnet#7820)
  Add Unit Test for testOnly apps (dotnet#7637)
  [build] Only build the latest API level (dotnet#7786)
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 24, 2023
* main:
  LEGO: Merge pull request 7825
  Bump to xamarin/Java.Interop/main@bbaeda6f (dotnet#7799)
  Bump NDK to r25c (dotnet#7808)
  [Xamarin.Android.Build.Tests] Improve logcat logging in failed tests (dotnet#7816)
  [Mono.Android] Update api-compat reference file for current API-33 (dotnet#7822)
  Localized file check-in by OneLocBuild Task (dotnet#7820)
  Add Unit Test for testOnly apps (dotnet#7637)
  [build] Only build the latest API level (dotnet#7786)
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 24, 2023
* main:
  LEGO: Merge pull request 7825
  Bump to xamarin/Java.Interop/main@bbaeda6f (dotnet#7799)
  Bump NDK to r25c (dotnet#7808)
  [Xamarin.Android.Build.Tests] Improve logcat logging in failed tests (dotnet#7816)
  [Mono.Android] Update api-compat reference file for current API-33 (dotnet#7822)
  Localized file check-in by OneLocBuild Task (dotnet#7820)
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 24, 2023
* main:
  LEGO: Merge pull request 7825
  Bump to xamarin/Java.Interop/main@bbaeda6f (dotnet#7799)
  Bump NDK to r25c (dotnet#7808)
  [Xamarin.Android.Build.Tests] Improve logcat logging in failed tests (dotnet#7816)
  [Mono.Android] Update api-compat reference file for current API-33 (dotnet#7822)
  Localized file check-in by OneLocBuild Task (dotnet#7820)
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 24, 2023
* main:
  LEGO: Merge pull request 7825
  Bump to xamarin/Java.Interop/main@bbaeda6f (dotnet#7799)
  Bump NDK to r25c (dotnet#7808)
  [Xamarin.Android.Build.Tests] Improve logcat logging in failed tests (dotnet#7816)
  [Mono.Android] Update api-compat reference file for current API-33 (dotnet#7822)
  Localized file check-in by OneLocBuild Task (dotnet#7820)
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 24, 2023
* main:
  LEGO: Merge pull request 7825
  Bump to xamarin/Java.Interop/main@bbaeda6f (dotnet#7799)
  Bump NDK to r25c (dotnet#7808)
  [Xamarin.Android.Build.Tests] Improve logcat logging in failed tests (dotnet#7816)
  [Mono.Android] Update api-compat reference file for current API-33 (dotnet#7822)
  Localized file check-in by OneLocBuild Task (dotnet#7820)
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 27, 2023
* main:
  Localized file check-in by OneLocBuild (dotnet#7827)
  Revert "Bump to dotnet/installer@d25a3bb 8.0.100-preview.2.23105.6 (dotnet#7769)"
  LEGO: Merge pull request 7828
  LEGO: Merge pull request 7825
  Bump to xamarin/Java.Interop/main@bbaeda6f (dotnet#7799)
  Bump NDK to r25c (dotnet#7808)
  [Xamarin.Android.Build.Tests] Improve logcat logging in failed tests (dotnet#7816)
  [Mono.Android] Update api-compat reference file for current API-33 (dotnet#7822)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants