question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test_history failure

See original GitHub issue

I am trying to package ipython 7.0.1 for openSUSE and I am getting the following error in the unit tests:

======================================================================
FAIL: IPython.core.tests.test_history.test_history
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python3.6/site-packages/IPython/core/tests/test_history.py", line 113, in test_history
    newhist[3]])
AssertionError: Lists differ: [(1, [51 chars]rn test'), (1, 3, "b='€Æ¾÷ß'"), (2, 1, 'z=5'), (2, 3, "k='p'")] != [(1, [51 chars]rn test'), (1, 3, "b='€Æ¾÷ß'"), (2, 3, "k='p'"), (2, 4, 'z=5')]

First differing element 3:
(2, 1, 'z=5')
(2, 3, "k='p'")

  [(1, 1, 'a=1'),
   (1, 2, 'def f():\n    test = 1\n    return test'),
   (1, 3, "b='€Æ¾÷ß'"),
-  (2, 1, 'z=5'),
-  (2, 3, "k='p'")]
?                 ^

+  (2, 3, "k='p'"),
?                 ^

+  (2, 4, 'z=5')]
-------------------- >> begin captured stdout << ---------------------
def f():
    test = 1
    return test
b='€Æ¾÷ß'
The following commands were written to file `/tmp/tmphhgt1b7l/tmpsytny8bh/test4.py`:
a=1
def f():
    test = 1
    return test
b='€Æ¾÷ß'

--------------------- >> end captured stdout << ----------------------
    """Fail immediately, with the given message."""
>>  raise self.failureException('Lists differ: [(1, [51 chars]rn test\'), (1, 3, "b=\'€Æ¾÷ß\'"), (2, 1, \'z=5\'), (2, 3, "k=\'p\'")] != [(1, [51 chars]rn test\'), (1, 3, "b=\'€Æ¾÷ß\'"), (2, 3, "k=\'p\'"), (2, 4, \'z=5\')]\n\nFirst differing element 3:\n(2, 1, \'z=5\')\n(2, 3, "k=\'p\'")\n\n  [(1, 1, \'a=1\'),\n   (1, 2, \'def f():\\n    test = 1\\n    return test\'),\n   (1, 3, "b=\'€Æ¾÷ß\'"),\n-  (2, 1, \'z=5\'),\n-  (2, 3, "k=\'p\'")]\n?                 ^\n\n+  (2, 3, "k=\'p\'"),\n?                 ^\n\n+  (2, 4, \'z=5\')]')
    

----------------------------------------------------------------------

It looks like the last two list elements have switched places but I don’t know why that might be the case.


EDIT:

We can likely fix this issue in two steps:

  1. mark the test as skip (or known fail) for the range of sqlite versions that appear to be affected.
  2. actually figure out if this is a change in behavior worth fixing or if the test should be updated accordingly.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
Carreaucommented, Oct 15, 2018

I think it’s without underscore on IPython codebase.

For example there.

@dsblank have you tried RipGrep ? Really good: skip .git by default, search recursively by default, color highlight, and filter by file types. Fr example search for skipif only in python files:

$ rg @skipif -tpy
IPython/extensions/tests/test_autoreload.py
133:    @skipif(sys.version_info < (3, 6))

IPython/core/tests/test_interactiveshell.py
531:    @skipif(not hasattr(signal, 'SIGALRM'))

IPython/lib/tests/test_latextools.py
47:@skipif_not_matplotlib
62:@skipif_not_matplotlib

IPython/lib/tests/test_display.py
182:@skipif_not_numpy
 ~/dev/ipython[master ✗] $ rg @skip_if -tpy
IPython/lib/tests/test_clipboard.py
7:@skip_if_no_x11

IPython/utils/tests/test_path.py
102:@skip_if_not_win32
117:@skip_if_not_win32
157:@skip_if_not_win32
377:    @skip_if_not_win32
468:    @skip_if_not_win32

… and 10x faster on my machine.

1reaction
jcbollingercommented, Apr 20, 2020

For future reference and maybe a real fix sometime, this appears to be happening because ipython uses an SQL “GROUP BY” clause to squash duplicates, while also selecting and ordering by columns that are neither grouping columns nor aggregate functions (session and line). Neither SQL nor sqlite specify from which row of each resulting group the values for those so-called “bare” columns will be drawn, and apparently sqlite’s actual behavior changed in that regard.

I tried a couple of variations on the generated SQL, with no success against sqlite3 3.26.0. There are certainly ways to do it, but there’s a question of the size of the changes required and their effect on search performance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test history incomplete - some test failures missing
There are some tests that are failing intermittently in a variety of branches, in a variety of builds definitions / clusters. I was...
Read more >
History of last 10 test failures in JUnit report - GitLab.org
Problem(s) to solve Today when a test fails it is very hard to ... more users who view the JUnit report page click...
Read more >
Activities - Show Test History - Error - Unable to retrieve data ...
In Web Client Activities -> Show Test History throws an error: Test History Details Error Unable to retrieve data. Test History Details -...
Read more >
Test duration chart on test history does not properly display failure ...
Test duration chart on test history does not properly display failure for the tests run several times within a build ; Project, TeamCity...
Read more >
Test History - Currents Documentation - Currents.dev
Cypress test history - flaky, passed and failed instances. Each individual dot is an instance of the test. The dots are arranged in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found