diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetInternal/WeakAsset.h b/Code/Framework/AzCore/AzCore/Asset/AssetInternal/WeakAsset.h index 1384511e78..3d4fa6c50e 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetInternal/WeakAsset.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetInternal/WeakAsset.h @@ -141,13 +141,17 @@ namespace AZ::Data::AssetInternal if (assetData) { - assetData->AcquireWeak(); + // This should be AcquireWeak but we're using strong references for now to disable asset cancellation + // until it is more stable + assetData->Acquire(); m_assetId = assetData->GetId(); } if (m_assetData) { - m_assetData->ReleaseWeak(); + // This should be ReleaseWeak but we're using strong references for now to disable asset cancellation + // until it is more stable + m_assetData->Release(); } m_assetData = assetData; diff --git a/Code/Framework/AzCore/Tests/Asset/AssetCommon.cpp b/Code/Framework/AzCore/Tests/Asset/AssetCommon.cpp index d0e34487ea..c829821ca6 100644 --- a/Code/Framework/AzCore/Tests/Asset/AssetCommon.cpp +++ b/Code/Framework/AzCore/Tests/Asset/AssetCommon.cpp @@ -186,7 +186,8 @@ namespace UnitTest int GetWeakUseCount() { return m_weakUseCount.load(); } }; - TEST_F(WeakAssetTest, WeakAsset_ConstructionAndDestruction_UpdatesAssetDataWeakRefCount) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(WeakAssetTest, DISABLED_WeakAsset_ConstructionAndDestruction_UpdatesAssetDataWeakRefCount) { TestAssetData testData; EXPECT_EQ(testData.GetWeakUseCount(), 0); @@ -202,7 +203,8 @@ namespace UnitTest EXPECT_EQ(testData.GetWeakUseCount(), 0); } - TEST_F(WeakAssetTest, WeakAsset_MoveOperatorWithDifferentData_UpdatesOldAssetDataWeakRefCount) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(WeakAssetTest, DISABLED_WeakAsset_MoveOperatorWithDifferentData_UpdatesOldAssetDataWeakRefCount) { TestAssetData testData; EXPECT_EQ(testData.GetWeakUseCount(), 0); @@ -217,7 +219,8 @@ namespace UnitTest AZ_TEST_STOP_TRACE_SUPPRESSION(1); } - TEST_F(WeakAssetTest, WeakAsset_MoveOperatorWithSameData_PreservesAssetDataWeakRefCount) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(WeakAssetTest, DISABLED_WeakAsset_MoveOperatorWithSameData_PreservesAssetDataWeakRefCount) { TestAssetData testData; EXPECT_EQ(testData.GetWeakUseCount(), 0); @@ -234,7 +237,8 @@ namespace UnitTest AZ_TEST_STOP_TRACE_SUPPRESSION(1); } - TEST_F(WeakAssetTest, WeakAsset_AssignmentOperator_CopiesDataAndIncrementsWeakRefCount) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(WeakAssetTest, DISABLED_WeakAsset_AssignmentOperator_CopiesDataAndIncrementsWeakRefCount) { TestAssetData testData; EXPECT_EQ(testData.GetWeakUseCount(), 0); diff --git a/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp b/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp index 15f2b0bf86..34b6918400 100644 --- a/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp +++ b/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp @@ -2677,7 +2677,8 @@ namespace UnitTest #if AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS TEST_F(AssetManagerCancelTests, DISABLED_CancelLoad_NoReferences_LoadCancels) #else - TEST_F(AssetManagerCancelTests, CancelLoad_NoReferences_LoadCancels) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(AssetManagerCancelTests, DISABLED_CancelLoad_NoReferences_LoadCancels) #endif // AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS { m_assetHandlerAndCatalog->SetArtificialDelayMilliseconds(0, 100); @@ -2717,7 +2718,8 @@ namespace UnitTest #if AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS TEST_F(AssetManagerCancelTests, DISABLED_CanceledLoad_CanBeLoadedAgainLater) #else - TEST_F(AssetManagerCancelTests, CanceledLoad_CanBeLoadedAgainLater) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(AssetManagerCancelTests, DISABLED_CanceledLoad_CanBeLoadedAgainLater) #endif // AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS { m_assetHandlerAndCatalog->SetArtificialDelayMilliseconds(0, 50); @@ -2766,7 +2768,8 @@ namespace UnitTest #if AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS TEST_F(AssetManagerCancelTests, DISABLED_CancelLoad_InProgressLoad_Continues) #else - TEST_F(AssetManagerCancelTests, CancelLoad_InProgressLoad_Continues) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(AssetManagerCancelTests, DISABLED_CancelLoad_InProgressLoad_Continues) #endif // AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS { m_assetHandlerAndCatalog->SetArtificialDelayMilliseconds(0, 100); @@ -2988,8 +2991,9 @@ namespace UnitTest TEST_F(AssetManagerClearAssetReferenceTests, DISABLED_ContainerLoadTest_AssetLosesAndGainsReferencesDuringLoadAndSuspendedRelease_AssetSuccessfullyFinishesLoading) #else + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable TEST_F(AssetManagerClearAssetReferenceTests, - ContainerLoadTest_AssetLosesAndGainsReferencesDuringLoadAndSuspendedRelease_AssetSuccessfullyFinishesLoading) + DISABLED_ContainerLoadTest_AssetLosesAndGainsReferencesDuringLoadAndSuspendedRelease_AssetSuccessfullyFinishesLoading) #endif // AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS { // Start the load and wait for the dependent asset to hit the loading state. @@ -3046,7 +3050,8 @@ namespace UnitTest #if AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS TEST_F(AssetManagerClearAssetReferenceTests, DISABLED_ContainerLoadTest_RootAssetDestroyedWhileContainerLoading_ContainerFinishesLoad) #else - TEST_F(AssetManagerClearAssetReferenceTests, ContainerLoadTest_RootAssetDestroyedWhileContainerLoading_ContainerFinishesLoad) + // Asset cancellation is temporarily disabled, re-enable this test when cancellation is more stable + TEST_F(AssetManagerClearAssetReferenceTests, DISABLED_ContainerLoadTest_RootAssetDestroyedWhileContainerLoading_ContainerFinishesLoad) #endif // AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_TESTS { OnAssetReadyListener assetStatus1(DependentPreloadAssetId, azrtti_typeid());