We have a lot of places where we’re using global state to change the SDK’s behaviour in test cases. Global state means that the execution of one test case can influence that of another, leading to issues such as #1241, which prevent us from making changes that we might like to in the future, such as running the tests in parallel (because one test may have some hidden accidental dependency on another test having run before it).
In #1603 I gave an example of how we might go about removing this global state, by removing the setter for +[ARTDefault realtimeRequestTimeout] and instead injecting it into the SDK via an ARTTestClientOptions property. We should do the same for the rest of the global mutable state in the SDK. That means removing the following setters:
This issue only relates to the global state in the SDK. The test suite itself has global state, too, which we'll need to address separately (#1604).
┆Issue is synchronized with this Jira Task by Unito
We have a lot of places where we’re using global state to change the SDK’s behaviour in test cases. Global state means that the execution of one test case can influence that of another, leading to issues such as #1241, which prevent us from making changes that we might like to in the future, such as running the tests in parallel (because one test may have some hidden accidental dependency on another test having run before it).
In #1603 I gave an example of how we might go about removing this global state, by removing the setter for
+[ARTDefault realtimeRequestTimeout]and instead injecting it into the SDK via anARTTestClientOptionsproperty. We should do the same for the rest of the global mutable state in the SDK. That means removing the following setters:+[ARTDefault setConnectionStateTtl:]+[ARTDefault setMaxMessageSize:]+[ARTWebSocketTransport setWebSocketClass:]+[ARTClientOptions setDefaultEnvironment:]+[ARTHttp setURLSessionClass:]ARTFallback_shuffleArrayvariable — done in MakeARTFallback_shuffleArrayconstant #1672-[ARTRestInternal resetDeviceSingleton](WIP in Mock device fetcher #1681)ARTLocalDeviceStorage, which writes to the keychain and user defaultstestSuite_injectIntoClassMethodThis issue only relates to the global state in the SDK. The test suite itself has global state, too, which we'll need to address separately (#1604).
┆Issue is synchronized with this Jira Task by Unito