Is it safe to call XCTestExpectation fulfill method on background thread?
<p>I am using <code>XCTestExpectation</code> in a lot of tests and sometimes (very randomly) some expectations are not fulfilled (although I am sure they should be). </p>

<p>While investigating this problem I have noticed that some expectations are fulfilled in a main thread and some are fulfilled in a background thread. And so far these problems are with the ones fulfilled in a background thread. </p>

<p>Is it safe to fulfill expectations from a background thread? I could not find any explicit information about that.</p>

<p>Below is an example of how I use <code>XCTestExpectation</code>:</p>

<pre><code>__block XCTestExpectation *expectation = [self expectationWithDescription:@"test"];

[self doSomethingAsyncInBackgroundWithSuccess:^{
    [expectation fullfill];
}];

[self waitForExpectationsWithTimeout:10.0 handler:^(NSError *error) {
    expectation = nil;
    if (error) {
        NSLog(@"Timeout Error: %@", error);
    }
}];
</code></pre>