@@ -53,7 +53,7 @@ public async Task CaptureException_WhenAttachScreenshots_ContainsScreenshotAttac
5353 var builder = _fixture . Builder . UseSentry ( ) ;
5454
5555 // Act
56- using var app = builder . Build ( ) ;
56+ await using var app = builder . Build ( ) ;
5757 var client = app . Services . GetRequiredService < ISentryClient > ( ) ;
5858 var sentryId = client . CaptureException ( new Exception ( ) ) ;
5959 await client . FlushAsync ( ) ;
@@ -94,13 +94,11 @@ public async Task CaptureException_RemoveScreenshot_NotContainsScreenshotAttachm
9494 ) ) ;
9595
9696 // Act
97- using var app = builder . Build ( ) ;
97+ await using var app = builder . Build ( ) ;
9898 var client = app . Services . GetRequiredService < ISentryClient > ( ) ;
9999 var sentryId = client . CaptureException ( new Exception ( ) ) ;
100100 await client . FlushAsync ( ) ;
101101
102- var options = app . Services . GetRequiredService < IOptions < SentryMauiOptions > > ( ) . Value ;
103-
104102 var envelope = _fixture . Transport . GetSentEnvelopes ( ) . FirstOrDefault ( e => e . TryGetEventId ( ) == sentryId ) ;
105103 envelope . Should ( ) . NotBeNull ( ) ;
106104
@@ -116,22 +114,21 @@ public async Task CaptureException_BeforeCaptureScreenshot_DisableCaptureAsync()
116114#if __IOS__
117115 Skip . If ( true , "Flaky on iOS" ) ;
118116#endif
117+ #if ANDROID
118+ Skip . If ( TestEnvironment . IsGitHubActions , "Flaky in CI on Android" ) ;
119+ #endif
119120
120121 // Arrange
121- var builder = _fixture . Builder . UseSentry ( options => options . SetBeforeScreenshotCapture ( ( e , hint ) =>
122- {
123- return false ;
124- }
122+ var builder = _fixture . Builder . UseSentry ( options => options . SetBeforeScreenshotCapture (
123+ ( _ , _ ) => false
125124 ) ) ;
126125
127126 // Act
128- using var app = builder . Build ( ) ;
127+ await using var app = builder . Build ( ) ;
129128 var client = app . Services . GetRequiredService < ISentryClient > ( ) ;
130129 var sentryId = client . CaptureException ( new Exception ( ) ) ;
131130 await client . FlushAsync ( ) ;
132131
133- var options = app . Services . GetRequiredService < IOptions < SentryMauiOptions > > ( ) . Value ;
134-
135132 var envelope = _fixture . Transport . GetSentEnvelopes ( ) . FirstOrDefault ( e => e . TryGetEventId ( ) == sentryId ) ;
136133 envelope . Should ( ) . NotBeNull ( ) ;
137134
@@ -157,10 +154,8 @@ public async Task CaptureException_BeforeCaptureScreenshot_DefaultAsync()
157154#endif
158155
159156 // Arrange
160- var builder = _fixture . Builder . UseSentry ( options => options . SetBeforeScreenshotCapture ( ( e , hint ) =>
161- {
162- return true ;
163- }
157+ var builder = _fixture . Builder . UseSentry ( options => options . SetBeforeScreenshotCapture (
158+ ( _ , _ ) => true
164159 ) ) ;
165160
166161 // Act
@@ -184,19 +179,20 @@ public async Task CaptureException_BeforeCaptureScreenshot_DefaultAsync()
184179 }
185180 else
186181 {
187- envelopeItem . Should ( ) . NotBeNull ( ) ;
182+ envelopeItem . Should ( ) . NotBeNull ( ) ;
188183 envelopeItem ! . TryGetFileName ( ) . Should ( ) . Be ( "screenshot.jpg" ) ;
189184 }
190185 }
191186
192- [ Fact ]
187+ [ SkippableFact ]
193188 public async Task CaptureException_AttachScreenshot_Threadsafe ( )
194189 {
190+ #if ANDROID
191+ Skip . If ( TestEnvironment . IsGitHubActions , "Flaky in CI on Android" ) ;
192+ #endif
193+
195194 // Arrange
196- var builder = _fixture . Builder . UseSentry ( options =>
197- {
198- options . AttachScreenshot = true ;
199- } ) ;
195+ var builder = _fixture . Builder . UseSentry ( options => options . AttachScreenshot = true ) ;
200196 await using var app = builder . Build ( ) ;
201197 var client = app . Services . GetRequiredService < ISentryClient > ( ) ;
202198
0 commit comments