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

Add more extensive coverage for Task.Timeout #3388

Merged
merged 5 commits into from
Jul 21, 2023

Cover final line

fa07be0
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Add more extensive coverage for Task.Timeout #3388

Cover final line
fa07be0
Select commit
Loading
Failed to load commit list.
GitHub Actions / Results Code Coverage failed Jul 21, 2023 in 0s

Results Code Coverage ❌

Tests failed

❌ TestResults.Linux.xml

5669 tests were completed in 970s with 5652 passed, 3 failed and 14 skipped.

Test suite Passed Failed Skipped Time
Realm.Tests.dll.Realms.Tests.Database.AsyncTests. 14✔️ 1❌ 1s
Realm.Tests.dll.Realms.Tests.Sync.FlexibleSyncTests. 62✔️ 1❌ 55s
Realm.Tests.dll.Realms.Tests.Sync.UserManagementTests. 46✔️ 1❌ 1✖️ 51s

❌ Realm.Tests.dll.Realms.Tests.Database.AsyncTests.

Realms.Tests.Database.AsyncTests
  ❌ AsyncBeginWrite_CancelToken_OnAwait
	System.ObjectDisposedException : Safe handle has been closed.
	Object name: 'SafeHandle'.
  ✔️ AsyncBeginWrite_CloseRealm_DoesNotPersistData
  ✔️ AsyncBeginWrite_RollBack_DoesNotPersistData
  ✔️ AsyncBeginWrite_ThrowsUserException
  ✔️ AsyncBeginWriteAndCommit
  ✔️ AsyncWrite_CancelToken_OnAwait
  ✔️ AsyncWrite_FifoOrderRespected
  ✔️ AsyncWrite_FuncRealmObj
  ✔️ AsyncWrite_SyncCommit_Mixed
  ✔️ AsyncWrite_WithActionCallback_PersistsChanges
  ✔️ AsyncWriteSyncWrite_Mixed_NoDeadlock
  ✔️ RefreshAsync_Tests
  ✔️ SyncWrite_AsyncCommit_Mixed
  ✔️ WriteAsync_CaptureObjectsInDelegate_DoesNotThrow
  ✔️ WriteAsync_StartMultipleAsyncTransaction_NoDeadlock

❌ Realm.Tests.dll.Realms.Tests.Sync.FlexibleSyncTests.

Realms.Tests.Sync.FlexibleSyncTests
  ✔️ Integration_AfterAnError_CanRecover
  ✔️ Integration_CloseRealmBeforeWaitCompletes
  ✔️ Integration_CreateObjectNotMatchingSubscriptions_ShouldError
  ✔️ Integration_RealmRemoveAllWithSubscriptions
  ✔️ Integration_SubscriptionOnUnqueryableField_ShouldAddThemAutomatically
  ✔️ Integration_SubscriptionSet_AddRemove
  ✔️ Integration_SubscriptionSet_MoveObjectInsideView
  ❌ Integration_SubscriptionSet_MoveObjectOutsideView
	  State should be 'Complete' after GetInstanceAsync
	  Expected: Complete
	  But was:  Pending
	
  ✔️ Integration_SubscriptionSet_WaitForSynchronization_CanBeCalledMultipleTimes
  ✔️ Integration_SubscriptionWithEmbeddedObjects
  ✔️ Integration_SubscriptionWithLinks
  ✔️ Integration_SubscritpionWithCollections
  ✔️ Integration_UpdateObjectNotMatchingSubscriptions_ShouldError
  ✔️ Integration_UpdatingSubscription_SupersedesPreviousOnes
  ✔️ Integration_WaitForSynchronization_EmptyUpdate
  ✔️ Integration_WriteData_WhenOutsideOfSubscriptions_GetsRevertedByServer
  ✔️ Realm_Subscriptions_WhenDisposed_Throws
  ✔️ Realm_Subscriptions_WhenFLX_ReturnsSubscriptions
  ✔️ Realm_Subscriptions_WhenLocalRealm_Throws
  ✔️ Realm_Subscriptions_WhenPBS_Throws
  ✔️ Realm_Subscriptions_WhenSameVersion_ReturnsExistingReference
  ✔️ Realm_Subscriptions_WhenVersionIsGCed_CreatesANewOne
  ✔️ SubscriptionSet_Add_AddsSubscription
  ✔️ SubscriptionSet_Add_ComplexQuery_AddsSubscription
  ✔️ SubscriptionSet_Add_WithoutUpdate_Throws
  ✔️ SubscriptionSet_AddSameName_DifferentType_UpdateExisting_Updates
  ✔️ SubscriptionSet_AddSameName_NoUpdate_WhenDifferentQuery_Throws
  ✔️ SubscriptionSet_AddSameName_NoUpdate_WhenDifferentType_Throws
  ✔️ SubscriptionSet_AddSameName_NoUpdate_WhenIdentical_DoesntThrow
  ✔️ SubscriptionSet_AddSameName_UpdateExisting_Updates
  ✔️ SubscriptionSet_AddSameQuery_DifferentClasses_AddsBoth
  ✔️ SubscriptionSet_AddTwice_Deduplicates
  ✔️ SubscriptionSet_AddTwice_DifferentNames_Duplicates
  ✔️ SubscriptionSet_AddTwice_NamedAndUnnamed_Duplicates
  ✔️ SubscriptionSet_Enumerator
  ✔️ SubscriptionSet_Enumerator_DoubleDispose_Throws
  ✔️ SubscriptionSet_Enumerator_Reset
  ✔️ SubscriptionSet_FindByName_Finds
  ✔️ SubscriptionSet_FindByName_ReturnsNullWhenMissing
  ✔️ SubscriptionSet_FindByQuery_Finds
  ✔️ SubscriptionSet_FindByQuery_ReturnsNullWhenMissing
  ✔️ SubscriptionSet_GetsGarbageCollected
  ✔️ SubscriptionSet_Indexer
  ✔️ SubscriptionSet_Iteration
  ✔️ SubscriptionSet_Remove_ByName
  ✔️ SubscriptionSet_Remove_ByName_OutsideUpdate_Throws
  ✔️ SubscriptionSet_Remove_ByQuery_RemoveNamed
  ✔️ SubscriptionSet_Remove_ByQuery_RemoveNamed_False
  ✔️ SubscriptionSet_Remove_Subscription
  ✔️ SubscriptionSet_Remove_Subscription_OutsideUpdate_Throws
  ✔️ SubscriptionSet_RemoveAll_RemoveNamed
  ✔️ SubscriptionSet_RemoveAll_RemoveNamed_False
  ✔️ SubscriptionSet_RemoveByType_Generic_RemoveNamed
  ✔️ SubscriptionSet_RemoveByType_Generic_RemoveNamed_False
  ✔️ SubscriptionSet_RemoveByType_RemoveNamed
  ✔️ SubscriptionSet_RemoveByType_RemoveNamed_False
  ✔️ SubscriptionSet_Update_IncrementsVersion
  ✔️ SubscriptionSet_Update_UpdatesItself
  ✔️ SubscriptionSet_Update_WhenActionThrows_RollsbackTransaction
  ✔️ SubscriptionSet_Update_WhenEmpty_Succeeds
  ✔️ SubscriptionSet_Update_WhenTransactionIsInProgress_Throws
  ✔️ SubscriptionSet_WhenParentRealmIsClosed_GetsClosed
  ✔️ SubscriptionSet_WhenSupersededParentRealmIsClosed_GetsClosed

❌ Realm.Tests.dll.Realms.Tests.Sync.UserManagementTests.

Realms.Tests.Sync.UserManagementTests
  ✔️ AppAllUsers_WhenThereAreNineUsers_ShouldReturnAllOfThem
  ✔️ AppAllUsers_WhenThereAreNoUsers_ShouldReturnEmptyCollection
  ✔️ AppAllUsers_WhenThereIsOneUser_ShouldReturnThatUser
  ✔️ AppCurrentUser_WhenThereAreNoUsers_ShouldReturnNull
  ✔️ AppCurrentUser_WhenThereIsMoreThanOneUser_ShouldReturnLastOne
  ✔️ AppCurrentUser_WhenThereIsOneUser_ShouldReturnThatUser
  ✔️ AppDeleteUserFromServer_RemovesUser
  ✔️ AppRemoveUser_RemovesUser
  ✔️ AppSwitchUser_SwitchesCurrentUser
  ✔️ AppSwitchUser_WhenUserIsCurrent_DoesNothing
  ✔️ AppSwitchUser_WhenUserIsNull_Throws
  ✔️ EmailPasswordRegisterUser_Works
  ✖️ User_Facebook_LogsInAndReadsDataFromFacebook
  ✔️ User_JWT_LogsInAndReadsDataFromToken
  ✔️ User_LinkCredentials_AllowsLoginWithNewCredentials
  ✔️ User_LinkCredentials_MultipleTimes_AllowsLoginWithAllCredentials
  ✔️ User_LinkCredentials_MultipleTimesSameCredentials_IsNoOp
  ✔️ User_LinkCredentials_WhenAnonymous_Throws
  ✔️ User_LinkCredentials_WhenInUse_Throws
  ✔️ User_LinkCredentials_WhenMultipleEmailPassword_Throws
  ✔️ UserAnonymous_CombiningReuseAndNotReuse
  ✔️ UserApiKeys_CanLoginWithGeneratedKey
  ✔️ UserApiKeys_CanLoginWithReenabledKey
  ❌ UserApiKeys_CantLoginWithDeletedKey
	Exception of type Realms.Sync.Exceptions.AppException expected but method didn't throw.
  ✔️ UserApiKeys_CantLoginWithDisabledKey
  ✔️ UserApiKeys_Create_CreatesApiKeyAndRevealsValue
  ✔️ UserApiKeys_Create_WithInvalidName_Throws
  ✔️ UserApiKeys_DeleteKey_WithExistingId
  ✔️ UserApiKeys_DeleteKey_WithNonExistingId
  ✔️ UserApiKeys_Disable_DisablesKey
  ✔️ UserApiKeys_DisableApiKey_WhenDisabled_IsNoOp
  ✔️ UserApiKeys_DisableApiKey_WhenNonExistent_Throws
  ✔️ UserApiKeys_Enable_ReenablesKey
  ✔️ UserApiKeys_EnableApiKey_WhenEnabled_IsNoOp
  ✔️ UserApiKeys_EnableApiKey_WhenNonExistent_Throws
  ✔️ UserApiKeys_Fetch_WhenIdDoesntMatch_ReturnsNull
  ✔️ UserApiKeys_Fetch_WhenIdMatches_ReturnsKey
  ✔️ UserApiKeys_Fetch_WhenNoneExist_ReturnsNull
  ✔️ UserApiKeys_FetchAll_WithMultipleKeys
  ✔️ UserApiKeys_FetchAll_WithNoKeys
  ✔️ UserApiKeys_FetchAll_WithOneKey
  ✔️ UserCustomData
  ✔️ UserCustomData_Generic
  ✔️ UserCustomData_Generic_ReadsFromAccessToken
  ✔️ UserCustomData_ReadsFromAccessToken
  ✔️ UserCustomData_WhenEmpty_ReturnsNull
  ✔️ UserEqualsOverrides
  ✔️ UserToStringOverride

Annotations

Check failure on line -1 in No path available

See this annotation in the file changed.

@github-actions github-actions / Results Code Coverage

Realm.Tests.dll.Realms.Tests.Database.AsyncTests. ► Realms.Tests.Database.AsyncTests ► AsyncBeginWrite_CancelToken_OnAwait

Failed test found in:
  TestResults.Linux.xml
Error:
  System.ObjectDisposedException : Safe handle has been closed.
  Object name: 'SafeHandle'.
Raw output
   at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
   at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success)
   at Realms.SharedRealmHandle.NativeMethods.cancel_async_transaction(SharedRealmHandle sharedRealm, UInt32 transaction_handle, NativeException& ex)
   at Realms.SharedRealmHandle.<>c__DisplayClass62_0.<OnTaskCancellation>b__0(Object _) in /home/runner/work/realm-dotnet/realm-dotnet/Realm/Realm/Handles/SharedRealmHandle.cs:line 921
   at Nito.AsyncEx.AsyncContext.AsyncContextSynchronizationContext.<>c__DisplayClass4_0.<Post>b__0()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
   at Nito.AsyncEx.AsyncContext.<Execute>b__12_0()
   at Nito.AsyncEx.SynchronizationContextSwitcher.ApplyContext(SynchronizationContext context, Action action)
   at Nito.AsyncEx.AsyncContext.Execute()
   at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
   at Realms.Tests.Database.AsyncTests.<>c__DisplayClass13_0.<AsyncBeginWrite_CancelToken_OnAwait>b__2() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/Database/AsyncTests.cs:line 367
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Realms.Tests.Database.AsyncTests.<AsyncBeginWrite_CancelToken_OnAwait>b__13_0() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/Database/AsyncTests.cs:line 381
   at TaskExtensions.Timeout(Task task, Int32 millisecondTimeout, Task errorTask, String detail) in /home/runner/work/realm-dotnet/realm-dotnet/Realm/Realm/Extensions/TaskExtensions.cs:line 69
   at Realms.Tests.TestHelpers.<>c__DisplayClass31_0.<<RunAsyncTest>b__0>d.MoveNext() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/TestHelpers.cs:line 265
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
   at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
   at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
   at Realms.Tests.TestHelpers.RunAsyncTest(Func`1 testFunc, Int32 timeout, Task errorTask) in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/TestHelpers.cs:line 263
   at Realms.Tests.Database.AsyncTests.AsyncBeginWrite_CancelToken_OnAwait() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/Database/AsyncTests.cs:line 351
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

Check failure on line -1 in No path available

See this annotation in the file changed.

@github-actions github-actions / Results Code Coverage

Realm.Tests.dll.Realms.Tests.Sync.FlexibleSyncTests. ► Realms.Tests.Sync.FlexibleSyncTests ► Integration_SubscriptionSet_MoveObjectOutsideView

Failed test found in:
  TestResults.Linux.xml
Error:
    State should be 'Complete' after GetInstanceAsync
    Expected: Complete
    But was:  Pending
  
Raw output
   at Realms.Tests.Sync.FlexibleSyncTests.<Integration_SubscriptionSet_MoveObjectOutsideView>b__52_0() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/Sync/FlexibleSyncTests.cs:line 1189
   at TaskExtensions.Timeout(Task task, Int32 millisecondTimeout, Task errorTask, String detail) in /home/runner/work/realm-dotnet/realm-dotnet/Realm/Realm/Extensions/TaskExtensions.cs:line 70
   at Realms.Tests.TestHelpers.<>c__DisplayClass31_0.<<RunAsyncTest>b__0>d.MoveNext() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/TestHelpers.cs:line 266
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)

Check failure on line -1 in No path available

See this annotation in the file changed.

@github-actions github-actions / Results Code Coverage

Realm.Tests.dll.Realms.Tests.Sync.UserManagementTests. ► Realms.Tests.Sync.UserManagementTests ► UserApiKeys_CantLoginWithDeletedKey

Failed test found in:
  TestResults.Linux.xml
Error:
  Exception of type Realms.Sync.Exceptions.AppException expected but method didn't throw.
Raw output
   at Realms.Tests.TestHelpers.AssertThrows[T](Func`1 function, Int32 timeout) in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/TestHelpers.cs:line 285
   at Realms.Tests.Sync.UserManagementTests.<UserApiKeys_CantLoginWithDeletedKey>b__43_0() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/Sync/UserManagementTests.cs:line 824
   at TaskExtensions.Timeout(Task task, Int32 millisecondTimeout, Task errorTask, String detail) in /home/runner/work/realm-dotnet/realm-dotnet/Realm/Realm/Extensions/TaskExtensions.cs:line 70
   at Realms.Tests.TestHelpers.<>c__DisplayClass31_0.<<RunAsyncTest>b__0>d.MoveNext() in /home/runner/work/realm-dotnet/realm-dotnet/Tests/Realm.Tests/TestHelpers.cs:line 266
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)