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

Testsuite: test_dask_multiprocessing fails with Python 3.11 #433

Open
juliangilbey opened this issue Dec 19, 2022 · 0 comments
Open

Testsuite: test_dask_multiprocessing fails with Python 3.11 #433

juliangilbey opened this issue Dec 19, 2022 · 0 comments

Comments

@juliangilbey
Copy link
Contributor

A FYI report: with Python 3.11, I'm seeing the following test failure:

__________________________ test_dask_multiprocessing ___________________________

tmpdir = local('/tmp/pytest-of-jdg/pytest-0/test_dask_multiprocessing2')

    @flaky(max_runs=3)
    @pytest.mark.skipif(not PY3,
                        reason="Only meant for Python 3")
    def test_dask_multiprocessing(tmpdir):
        """
        Test that dask multiprocessing works on Python 3.
        """
        # Command to start the kernel
        cmd = "from spyder_kernels.console import start; start.main()"
    
        with setup_kernel(cmd) as client:
            # Remove all variables
            client.execute("%reset -f")
            client.get_shell_msg(timeout=TIMEOUT)
    
            # Write multiprocessing code to a file
            # Runs two times to verify that in the second case it doesn't break
            code = """
    from dask.distributed import Client
    
    if __name__=='__main__':
        client = Client()
        client.close()
        x = 'hello'
    """
            p = tmpdir.join("mp-test.py")
            p.write(code)
    
            # Run code two times
            client.execute("runfile(r'{}')".format(to_text_string(p)))
            client.get_shell_msg(timeout=TIMEOUT)
    
            client.execute("runfile(r'{}')".format(to_text_string(p)))
            client.get_shell_msg(timeout=TIMEOUT)
    
            # Verify that the `x` variable is defined
            client.inspect('x')
            msg = client.get_shell_msg(timeout=TIMEOUT)
            while "found" not in msg['content']:
                msg = client.get_shell_msg(timeout=TIMEOUT)
            content = msg['content']
>           assert content['found']
E           assert False

console/tests/test_console_kernel.py:572: AssertionError

This is with Debian python3-dask version 2022.02.0+dfsg-2 and python3-distributed version 2022.02.0+ds.1-2.

Of course, Python 3.11 is not yet fully supported by debugpy, so this is just letting you know for when you do come to consider Python 3.11!

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

No branches or pull requests

1 participant