Assume there's a trigger on before-update of Account that sets Account.FIELD to "Value 1". A custom setting determines if it can run. This trigger along with related unit tests is included in a managed package.
Assume a client org has the same trigger that sets the same field to "Value 2".
If I attempt to install the package in the client org there may be an error due to failing unit tests (assume at the time of installation the packaged trigger runs before the local one, ignoring the fact that the order of execution is non-deterministic). Am I right?
What is the proper way to safely package the trigger?
Note that the 2 triggers can be easily controlled once the package has been installed. The problem is the package cannot control the client settings while it's being installed.