Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update matrix file each time a matrix changes while polling #533

Merged
merged 2 commits into from
Mar 29, 2019
Merged

Update matrix file each time a matrix changes while polling #533

merged 2 commits into from
Mar 29, 2019

Conversation

jschear
Copy link
Contributor

@jschear jschear commented Mar 28, 2019

When a Flank execution hangs (due to a broken test or an FTL outage) and is killed by a timeout (on Jenkins, Bitrise, etc.), it's nice to be able to find the FTL console link associated with each shard in order to debug the issue. These are normally printed to stdout at the end of a test run, but they might not be logged if the run is killed before completing.

Fortunately, Flank also persists a matrix_ids.json file to disk that contains the FTL link. This PR increases the frequency with which that file is updated, so that FTL links will make it into the file as soon as they're available.

I was hoping to add a test here but I was having trouble writing one that really covered this logic -- let me know if you have an idea for how to do that 😄

@CLAassistant
Copy link

CLAassistant commented Mar 28, 2019

CLA assistant check
All committers have signed the CLA.

@codecov-io
Copy link

Codecov Report

Merging #533 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #533   +/-   ##
========================================
  Coverage      78.6%   78.6%           
  Complexity      560     560           
========================================
  Files            77      77           
  Lines          2141    2141           
  Branches        289     289           
========================================
  Hits           1683    1683           
  Misses          289     289           
  Partials        169     169

@bootstraponline
Copy link
Contributor

Thanks. The change looks good. There's not a great way to test this until FTL open sources their mock server. The current mock server we have doesn't support polling. We could update it to support polling but I'm hoping to use the official FTL mock server in the future.

@bootstraponline bootstraponline merged commit b26187a into Flank:master Mar 29, 2019
@bootstraponline
Copy link
Contributor

if (MatrixState.completed(refreshedMatrix.state)) {
  break
}

that means we exit after a matrix reaches a final state. The write/update logic happens after that, and thus misses the final update to the the matrix_ids.json. I fixed this in: #534

I found the bug by using flank on our iOS Student app :)

@jschear
Copy link
Contributor Author

jschear commented Apr 1, 2019

🤦‍♂️ nice find, sorry about that!

@bootstraponline
Copy link
Contributor

no problem, it's a gap in our testing coverage 😄 I will hopefully be improving that in the future.

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.

4 participants