Skip to content

CI: Fix clipboard problems #29712

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

Merged
merged 27 commits into from
Jan 15, 2020
Merged

CI: Fix clipboard problems #29712

merged 27 commits into from
Jan 15, 2020

Conversation

datapythonista
Copy link
Member

@datapythonista datapythonista commented Nov 19, 2019

Fixes the clipboard problems in the CI. With this PR we're sure they are being run, and they work as expected.

@datapythonista datapythonista added CI Continuous Integration Unreliable Test Unit tests that occasionally fail labels Nov 19, 2019
@datapythonista
Copy link
Member Author

First run successful (problems uploading the coverage, but all tests passed in all builds). Restarting...

@datapythonista
Copy link
Member Author

Or I don't think this should harm, if you prefer to merge and see in the other builds... Otherwise I'll restart the job couple times more to see if this looks like it's fixing the unreliable test.

@datapythonista
Copy link
Member Author

Looks like this doesn't fix the problem. Re-reading again the docs, I think the new option would help errors if there are multiple xvfb processes, not if the wrapped command starts multiple processes.

I think it's still worth merging this, but still need to find out what's making that test fail.

@datapythonista datapythonista changed the title CI: Fix inconsistent clipboard test CI: Improved call to xvfb Nov 19, 2019
@TomAugspurger
Copy link
Contributor

@datapythonista maybe try 6557e9b out? I didn't look into the failures for that run. Turns out they were unrelated.

I'm not sure how pytest-xdist splits up modules, but if it's done after importing the file, that first one would have already run.

@datapythonista
Copy link
Member Author

@datapythonista maybe try 6557e9b out?

Will have a look. pytest-xdist should allocate whole files to workers, I guess that will happen in the worker already, but not sure.

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Nov 19, 2019 via email

@jbrockmendel
Copy link
Member

could we put this into an allowed_fail or something so this doesn't hang up other PRs? or would that make it too likely to slip through the cracks?

@TomAugspurger
Copy link
Contributor

Pushed up the deferred check. I think if that's failing and @datapythonista is out of ideas then we can xfail these tests.

@jbrockmendel
Copy link
Member

got green here. does that mean this is fixed or just a lucky run?

@datapythonista
Copy link
Member Author

Lucky run so far, let's try again...

Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

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

I don’t think we want this on the class. IUCC, the tests in the class have the clipboard mocked.

@datapythonista
Copy link
Member Author

Yep, you're right. Not sure why I thought only the methods using mock_clipboard as a parameter. A bit strange that the only test that actually tests the clipboard is that last one, that seems to be added later to test the long unicode characters.

What I see is that xsel is only installed in an Azure build. In the failing build qt is indirectly installed by conda. I want to see were tests fail if they are not skipped. They are skipped if the clipboard doesn't work, and I guess it works when xsel or qt are found, but it's difficult to really tell (even more when conda can be installing them because of an unrelated dependency).

I'll continue tomorrow, it's 2am here, but once we know where they are running we may want to do one of:

  • Install xsel there
  • Remove qt

I'd also remove the skip, and add to the patterns (not slow and not network and not clipboard) in the builds where we don't want them to run. Not beautiful, but understanding what is going on with the magic of skips is very difficult. And I think it's a good fix enough for now, considering that we should be simplifying the tests soon in #29685.

@datapythonista datapythonista changed the title CI: Improved call to xvfb WIP: Trying to fix clipboard error Nov 20, 2019
@datapythonista datapythonista changed the title WIP: Trying to fix clipboard error CI: Fix clipboard problems Jan 15, 2020
@datapythonista
Copy link
Member Author

@jreback @TomAugspurger this should fix the problems with the clipboard, and stop xfailing the tricky test.

What I'm doing here:

  • Be explicit on when we run the tests (previously, we ignored the clipboard tests if the pandas to_clipboard() method was failing)
  • Use xvfb when a X server is not available in the CI
  • Install xsel in all the builds where we test the clipboard
  • Uninstall qt, which was causing problems

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Jan 15, 2020 via email

@jreback jreback added this to the 1.0.0 milestone Jan 15, 2020
@jreback
Copy link
Contributor

jreback commented Jan 15, 2020

lgtm. I moved to the 1.0.0 milestone. @TomAugspurger if you are ok, merge away.

@TomAugspurger TomAugspurger merged commit 2cabca8 into pandas-dev:master Jan 15, 2020
@TomAugspurger
Copy link
Contributor

Thanks @datapythonista!

@mcepl
Copy link

mcepl commented Jun 30, 2020

The strange thing is that it seems this has not been fixed on i586. In openSUSE, test suite passes with x86_64, but fails with i586 on test_raw_rountrip:

[ 1652s] ______________________ test_raw_roundtrip[\U0001f44d...] _______________________
[ 1652s] [gw6] linux -- Python 3.8.3 /usr/bin/python3
[ 1652s] 
[ 1652s] data = '👍...'
[ 1652s] 
[ 1652s]     @pytest.mark.single
[ 1652s]     @pytest.mark.clipboard
[ 1652s]     @pytest.mark.parametrize("data", ["\U0001f44d...", "Ωœ∑´...", "abcd..."])
[ 1652s]     def test_raw_roundtrip(data):
[ 1652s]         # PR #25040 wide unicode wasn't copied correctly on PY3 on windows
[ 1652s]         clipboard_set(data)
[ 1652s] >       assert data == clipboard_get()
[ 1652s] E       AssertionError: assert '👍...' == ''
[ 1652s] E         + 👍...
[ 1652s] 
[ 1652s] ../../BUILDROOT/python-pandas-1.0.5-44.4.i386/usr/lib/python3.8/site-packages/pandas/tests/io/test_clipboard.py:256: AssertionError

Complete logs of the failing build

@TomAugspurger
Copy link
Contributor

Can you verify that the clipboard is set up properly on that system? If not then the clipboard tests need to be skipped.

@mcepl
Copy link

mcepl commented Jun 30, 2020

Can you verify that the clipboard is set up properly on that system? If not then the clipboard tests need to be skipped.

  1. What do you mean exactly by “properly set up clipboard”? This is chroot-based build system for openSUSE. We use xvfb-run to run tests in the fake X11 environment, but it is quite possible there is something wrong with it.

  2. Couldn’t the test system somehow identify problems with clipboard settings?

@TomAugspurger
Copy link
Contributor

We were erroneously skipping the clipboard tests so we decided to make these opt-out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Unreliable Test Unit tests that occasionally fail
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: Clipboard Test Failures on Travis
5 participants