Giter VIP home page Giter VIP logo

abagen's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @lonly7star from UIUC
  • ๐Ÿ‘€ Iโ€™m a Computer Science master student
  • ๐ŸŒฑ Iโ€™m currently learning how to identify and fix flaky test

abagen's People

Contributors

4lovi4 avatar abkosar avatar ellen-77 avatar gifuni avatar gshafiei avatar jamesfrierson1 avatar michaelnicht avatar rmarkello avatar vincebaz avatar yingqiuz avatar

Watchers

 avatar

abagen's Issues

Flaky Test on test_gene.py

Issue description

There is Order-Dependent flakiness in this testing code. The test will fail on the exact 36th run on a continual run.

Steps to reproduce the issue

  1. run pytest with flake-finder with command pytest -k test_gene.py --flake-finder
  2. or directly use the list to reproduce the failure.
    list_36 =  [6437, 19829, 17943, 4635, 16444, 4341, 8346, 1622, 19656, 15336]
    samples = GENES.loc[list_36]

What's the expected result?

  • The test pass

What's the actual result?

  • The test will fail on line 19 with the output:
    > assert sorted(names['name']) == sorted(samples['name'])
    AssertionError: assert ['RIKEN cDNA ...delta 2', ...] == ['RIKEN cDNA ...ining 9', ...]
    E At index 1 diff: 'RIKEN cDNA 9130019P16 gene' != 'RIKEN cDNA A230044A09 gene (non-RefSeq)'
    E Left contains one more item: 'vaccinia related kinase 1'
    E Use -v to get the full diff

Additional details / screenshot

The reason for this failure is the names will have 11 lines of Dataframe instead of 10.
The Dataframe of "samples"
samples
and the retrieved result Dataframe of "name"
names
Noticed the "RIKEN cDNA" has a duplicated line which caused the asserted error.

The duplicated key is generated on the code from abagen\abagen\utis.py, line 64
response = urlopen(url)
where it passed a Querying request to the server https://api.brain-map.org/api/v2/data/.. and the server returns with 11 lines of data include the extra line instead of 10 lines.

I suspect the flakiness is caused by the server-side that returns the duplicate key/value part.

As to the client part, a suggested fix is to add a check duplication for the return JSON.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.