2
votes

We have a problem with running wix/detox UI tests. They are unbearably slow.

We tried to eliminate everything we could, we disabled all background processes, we removed almost whole UI elements, we tried to disable automatic synchronization but nothing helped. It's definitely in order of magnitude slower than animation from detox docs.

Simple app with only 1 button, clicking on that button takes ~1.5s, when trying to run tests on some part of our UI, it takes 40s but there are only few buttons and text inputs.

The result it that our whole test suite runs 30 minutes (and we still don't have covered everything we want).

Typical logs:

Timed: animateWithDuration:delay:options:animations:completion:
Timed: animateWithDuration:delay:options:animations:completion:
Timed: animateWithDuration:delay:options:animations:completion:
Timed: animateWithDuration:delay:options:animations:completion:

(even there are no animations)

Or:

send: {"type":"currentStatus","params":{},"messageId":676}
send: {"type":"currentStatus","params":{},"messageId":677}
send: {"type":"currentStatus","params":{},"messageId":678}
send: {"type":"currentStatus","params":{},"messageId":679}
onMessage: {"type":"currentStatusResult","messageId":668,"params":{"state":"busy","resources":[{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x11692fdc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x116931300], width = 0x1, state = 0x001ffe9e00000300, dirty, max qos 6, in-flight = 0, thread = 0x303 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":668}}
rbx
Dispatch Queue: com.apple.main-thread
onMessage: {"type":"currentStatusResult","messageId":669,"params":{"state":"busy","resources":[{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x11692fdc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x116931300], width = 0x1, state = 0x001ffe9e00000300, dirty, max qos 6, in-flight = 0, thread = 0x303 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":669}}
rbx
Dispatch Queue: com.apple.main-thread
send: {"type":"currentStatus","params":{},"messageId":680}
send: {"type":"currentStatus","params":{},"messageId":681}
send: {"type":"currentStatus","params":{},"messageId":682}
onMessage: {"type":"currentStatusResult","messageId":670,"params":{"state":"busy","resources":[{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x11692fdc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x116931300], width = 0x1, state = 0x001ffe9e00000300, dirty, max qos 6, in-flight = 0, thread = 0x303 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":670}}
rbx

Library versions

detox: 6.0.0, 6.0.4, 7.0.0-alpha

react-native: 0.51.0

jest: 20.0.4

(we also tried mocha, no change)

1
From the logs it seems like there are still animations going on (maybe offscreen ?). Are you sure there are no animations running in a loop somewhere ?Rotemmiz
There are no animations I would know about. Sometimes you can see some animated components in UI hierarchy, but these are usually TouchableOpacity. But I tried to remove all touchable buttons and still, no effect. Aside from touchables, there are literally no animations at all. I even tried to create some minimal example. Tests are slow even for very simple app with just few labelstrubi
So this animation API is called by React Native internally for some unclear reason. Could you upload a demo project and post it here? @trubiLeo Natan
Also, do you have a cursor blinking?Leo Natan
Hello Leo, this is a sample project github.com/Crhaj/SampleApp-Detox this is screenshot of tests github.com/Crhaj/SampleApp-Detox/blob/master/testTimes.png these are sync logs github.com/Crhaj/SampleApp-Detox/blob/master/detox_logs/… This sample app looks slow as well and it's very simple. Thank you.trubi

1 Answers

0
votes

In my case, I had a background Redux Saga that ran every 1 second (code ran in a loop that ended with yield call(delay, 1000).

The 1-second interval was too tight for Detox to become free. Changing the delay to 2000 solved the problem.

The tightness of the timer may depend on the number of background sagas you have. Running 2 sagas at a 2000ms-interval may work, but running 100 sagas at the same interval may not.