We are running in a nightly process some Engine Tests and we noticed that Shaders.ShaderPreprocessor tests are failing with the following error:
Preprocessor fatal internal error: hash collision between ‘define’ and ‘define’ (Engine\Source\Developer\ShaderPreprocessor\Private\stb_preprocess\preprocessor.c 5177).
After some debugging the reason this happens is because “init_preprocessor” is called twice, once in FShaderPreprocessorModule::StartupModule and then again when running the tests when it calls the ExecutePreprocessTest function.
We are excluding the tests at the moment by adding an entry in our project’s DefaultEngine.ini
[AutomationTestExcludelist]
+ExcludeTest=(Map=“”,Test=“Shaders.ShaderPreprocessor”,Reason="Engine Tests fail because running ShaderPreprocessor tests causes to call ‘init_preprocessor’ twice. ,RHIs=(),Warn=False)
I don’t think we see this issue internally, but probably because we only run these unit tests via the LowLevelTests mechanism and not via AutomationTests (the latter does a full editor startup, likely the cause of the conflict here). I don’t know that there’s an easy way to fix this without adding deinit functionality and making it so that when run via automationtest the tests deinit, init with the custom callbacks, then re-run the normal module init afterwards.
Sounds reasonable, unless you’re modifying the preprocessor (which I’d hope you are not - do please let me know if you need to for some reason), there’s probably no need to waste CPU cycles running these tests. They are run regularly in our internal automation so should always be passing on all UE releases.