SPEC-6984 Fixed flaky test when user settings were written by ComponentApplication

main
pereslav 5 years ago
parent 5d03be5ed1
commit 43ffb2c872

@ -11,6 +11,7 @@
*/
#include <AzCore/UnitTest/UnitTest.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzQtComponents/Utilities/QtPluginPaths.h>
#include <AzTest/AzTest.h>
#include <AzTest/GemTestEnvironment.h>
@ -39,6 +40,15 @@ namespace Multiplayer
AddComponentDescriptors(descriptors);
}
/// Allows derived environments to override to perform additional steps after the system entity is activated.
void PostSystemEntityActivate() override
{
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
}
};
} // namespace UnitTest

Loading…
Cancel
Save