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

Fix recently added AndroidMessageHandler test #7859

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

grendello
Copy link
Contributor

Context: #7785
Context: 7b2e172

7b2e172 added changes to retry the test up to 5 times should
https://httpbin.org fail the request (e.g. because of throttling).
However, I skipped building the changes locally believing that should
anything be wrong, that CI would catch it. And it did, but the failures
weren't in the [Tests] tab but rather in a stage build log: the
Mono.Android.NET-Tests.csproj failed to build because the [Retry]
attribute is not available in NUnitLite which this test suite uses.
Additionally, Assert.Warn isn't supported either and the
DoCompression method should have been marked async.

Murphy must be laughing really hard now... :)

It should work now.

Context: dotnet#7785
Context: dotnet@7b2e172

7b2e172 added changes to retry the test up to 5 times should
https://httpbin.org fail the request (e.g. because of throttling).
However, I skipped building the changes locally believing that should
anything be wrong, that CI would catch it.  And it did, but the failures
weren't in the `[Tests]` tab but rather in a stage build log: the
`Mono.Android.NET-Tests.csproj` failed to build because the `[Retry]`
attribute is not available in `NUnitLite` which this test suite uses.
Additionally, `Assert.Warn` isn't supported either and the
`DoCompression` method should have been marked `async`.

Murphy must be laughing **really** hard now... :)

It should work now.
@grendello grendello requested a review from jonpryor as a code owner March 6, 2023 18:03
Assert.Warn ("Unexpected exception thrown");
Assert.Warn (ex.ToString ());
Console.WriteLine ("Unexpected exception thrown");
Console.WriteLine (ex.ToString ());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this instead use TestContext.Out.WriteLine()?

@dellis1972, @jonathanpeppers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that is the only way it would make it into a log.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neither TestContext.Out.WriteLine nor TestContext.WriteLine work. It appears that NUnitLite doesn't have that feature either :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok here: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7395571&view=artifacts&pathAsName=false&type=publishedArtifacts

run-Mono.Android.NET_Tests-Debug.binlog has lines like:

02-28 17:33:35.485  7425  7445 I NUnit   : JniValueMarshalerContractTests`1.CreateObjectReferenceArgumentState_DefaultValue 
02-28 17:33:35.486  7425  7445 I NUnit   :     Passed
02-28 17:33:35.486  7425  7445 I NUnit   : JniValueMarshalerContractTests`1.CreateReturnValueFromManagedExpression 
02-28 17:33:35.494  7425  7445 I DOTNET  : # jonp: expected: JniValueMarshaler_String_ContractTests

Ok, for this test Console.WriteLine() will work fine:
https://github.com/xamarin/java.interop/blob/77800dda83c2db4d90b501c00069abc9880caaeb/tests/Java.Interop-Tests/Java.Interop/JniValueMarshalerContractTests.cs#L267

It wouldn't work in our MSBuild tests, but Device Tests w/ NUnitLite this is the only option.

@jonpryor jonpryor merged commit 5470765 into dotnet:main Mar 6, 2023
@grendello grendello deleted the fix-http-decompression-test branch March 6, 2023 20:24
grendello added a commit to grendello/xamarin-android that referenced this pull request Mar 7, 2023
* main:
  Bump r8 from 4.0.48 to 4.0.52 (dotnet#7858)
  [tests] Fix recently added AndroidMessageHandler test (dotnet#7859)
  [build] remove darc dependency for System.IO.Hashing (dotnet#7855)
  Localized file check-in by OneLocBuild Task (dotnet#7851)
grendello added a commit to grendello/xamarin-android that referenced this pull request Mar 9, 2023
* main:
  [ci] Don't run classic tests on the Windows build/test stage (dotnet#7860)
  Bump to xamarin/Java.Interop/main@73ebad2 (dotnet#7861)
  Bump r8 from 4.0.48 to 4.0.52 (dotnet#7858)
  [tests] Fix recently added AndroidMessageHandler test (dotnet#7859)
  [build] remove darc dependency for System.IO.Hashing (dotnet#7855)
  Localized file check-in by OneLocBuild Task (dotnet#7851)
grendello added a commit to grendello/xamarin-android that referenced this pull request Mar 9, 2023
* main:
  [ci] Don't run classic tests on the Windows build/test stage (dotnet#7860)
  Bump to xamarin/Java.Interop/main@73ebad2 (dotnet#7861)
  Bump r8 from 4.0.48 to 4.0.52 (dotnet#7858)
  [tests] Fix recently added AndroidMessageHandler test (dotnet#7859)
  [build] remove darc dependency for System.IO.Hashing (dotnet#7855)
  Localized file check-in by OneLocBuild Task (dotnet#7851)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 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