Wolox / WLXBluetoothDevice

A block-based wrapper of CoreBluetooth
http://www.wolox.com.ar
MIT License
25 stars 8 forks source link

Fix random crashing tests #13

Closed guidomb closed 9 years ago

guidomb commented 9 years ago

Some tests crush randomly some times. Probably there is a race condition or something. Here is an example of test error that sometimes crashes sometimes passes

WLXServiceManagerSpec

spt_runExampleAtIndex:, "#disableNotificationsForCharacteristic:usingBlock: when the notifications are successfully enabled calls the peripheral's setNotifyValue:forCharacteristic method" failed to invoke done() callback before timeout (10.000000 seconds)

/Users/travis/build/Wolox/WLXBluetoothDevice/Example/Tests/WLXServiceManagerSpec.m:34

SpecBegin(WLXServiceManager)

spt_runExampleAtIndex:, "#disableNotificationsForCharacteristic:usingBlock: when the notifications could not be enabled calls the peripheral's setNotifyValue:forCharacteristic method" failed to invoke done() callback before timeout (10.000000 seconds)

/Users/travis/build/Wolox/WLXBluetoothDevice/Example/Tests/WLXServiceManagerSpec.m:34

SpecBegin(WLXServiceManager)

spt_runExampleAtIndex:, expected: <>, got: nil/null

/Users/travis/build/Wolox/WLXBluetoothDevice/Example/Tests/WLXServiceManagerSpec.m:490

usleep(100);

expect(observer.data).to.equal(data);

expect(observer.error).to.beNil;

Executed 137 tests, with 3 failures (1 unexpected) in 21.298 (21.355) seconds