Skip to content

Conversation

@mykola-mokhnach
Copy link
Contributor

@imurchie please take a look. I have tested this code with our automated framework and it seems there are no major issues there

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain what this is doing in prose a bit? also @imurchie should probably review

@mykola-mokhnach
Copy link
Contributor Author

mykola-mokhnach commented Dec 16, 2016

Sure. The task here is to prevent preemptive WDA startup by filtering out outdated log entries. The current implementation users idevicedate utility for this purpose with fallback to local machine date. The problem there is, that not all Appium users have idevice library properly updated, which causes idevicedate execution to fail. Appium cannot detect driver startup as a result, because it cannot distinguish old log entries from new old entries.

My approach tries to solve the issue without affecting idevicedate utility. It just executes logs minitoring asynchronously before xcodebuild execution. Then catches all the output collected by log reader utility so far and treats this as old logs. Then we set shared flag, which indicates xcodebuild has already started and continue monitoring logs. This monitoring blocks main thread until there is a new log record about WDA initialisation or timeout happens (hardcoded as 2 minutes). This helps to avoid endless loop in case something happened to WDA and it cannot start properly.

@imurchie
Copy link
Contributor

I haven't been able to get this working locally, with sims. It also fails in Travis (ignoring the linting problems).

@mykola-mokhnach
Copy link
Contributor Author

mykola-mokhnach commented Dec 16, 2016

That is strange :(
I'll try to play with it later to make the code stable on Travis

@imurchie
Copy link
Contributor

Locally it hangs and for some reason I cannot even stop the process. I ended up having to kill the terminal and then use lsof to find and kill the dead server. Very weird.

@mykola-mokhnach
Copy link
Contributor Author

@imurchie Hell yeah, it works on Travis now!

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM, @imurchie can you retest on your end?

@imurchie
Copy link
Contributor

@mykola-mokhnach I'm going to give this a shot locally, and look over what is going on.

Can you have a look, when you have time, at #327 ? It is solving the problem from another angle.

@mykola-mokhnach
Copy link
Contributor Author

Closed in favour of #327

@mykola-mokhnach mykola-mokhnach deleted the wait_for_wda branch December 22, 2016 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants