Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Lib/test/lock_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def f():
self.assertFalse(result[0])
lock.release()

@unittest.skip("TODO: RUSTPYTHON; sometimes hangs")
def test_acquire_contended(self):
lock = self.locktype()
lock.acquire()
Expand Down Expand Up @@ -210,7 +209,6 @@ def with_lock(err=None):
with Bunch(f, 1):
pass

@unittest.skip("TODO: RUSTPYTHON; sometimes hangs")
def test_thread_leak(self):
# The lock shouldn't leak a Thread instance when used from a foreign
# (non-threading) thread.
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@ def test_create_connection_local_addr(self):
self.assertEqual(port, expected)
tr.close()

@unittest.skipIf(sys.platform == "linux", "TODO: RUSTPYTHON; Flaky on CI")
@socket_helper.skip_if_tcp_blackhole
def test_create_connection_local_addr_skip_different_family(self):
# See https://github.com/python/cpython/issues/86508
Expand Down
8 changes: 0 additions & 8 deletions Lib/test/test_asyncio/test_free_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,6 @@ def tearDown(self):
def factory(self, loop, coro, **kwargs):
return asyncio.tasks._PyTask(coro, loop=loop, **kwargs)

@unittest.skip("TODO: RUSTPYTHON; hangs - Python _current_tasks dict not thread-safe")
def test_all_tasks_race(self):
return super().test_all_tasks_race()


@unittest.skipUnless(hasattr(asyncio.tasks, "_c_all_tasks"), "requires _asyncio")
class TestCFreeThreading(TestFreeThreading, TestCase):
Expand Down Expand Up @@ -224,10 +220,6 @@ class TestEagerPyFreeThreading(TestPyFreeThreading):
def factory(self, loop, coro, eager_start=True, **kwargs):
return asyncio.tasks._PyTask(coro, loop=loop, **kwargs, eager_start=eager_start)

@unittest.skip("TODO: RUSTPYTHON; hangs - Python _current_tasks dict not thread-safe")
def test_all_tasks_race(self):
return super().test_all_tasks_race()


@unittest.skipUnless(hasattr(asyncio.tasks, "_c_all_tasks"), "requires _asyncio")
class TestEagerCFreeThreading(TestCFreeThreading, TestCase):
Expand Down
6 changes: 2 additions & 4 deletions Lib/test/test_cmd_line_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,17 @@ def check_repl_stderr_flush(self, separate_stderr=False):
self.assertIn(b' ~^~', stderr.readline())
self.assertIn(b'ZeroDivisionError', stderr.readline())

@unittest.skip("TODO: RUSTPYTHON; test hang in middle")
def test_repl_stdout_flush(self):
self.check_repl_stdout_flush()

@unittest.skip("TODO: RUSTPYTHON; test hang in middle")
def test_repl_stdout_flush_separate_stderr(self):
self.check_repl_stdout_flush(True)

@unittest.skip("TODO: RUSTPYTHON; test hang in middle")
@unittest.skip("TODO: RUSTPYTHON; <stdin> traceback omits the source line and caret")
def test_repl_stderr_flush(self):
self.check_repl_stderr_flush()

@unittest.skip("TODO: RUSTPYTHON; test hang in middle")
@unittest.skip("TODO: RUSTPYTHON; <stdin> traceback omits the source line and caret")
def test_repl_stderr_flush_separate_stderr(self):
self.check_repl_stderr_flush(True)

Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3972,7 +3972,6 @@ class Color(StrMixin, AllMixin, Flag):
self.assertEqual(Color.ALL.value, 7)
self.assertEqual(str(Color.BLUE), 'blue')

@unittest.skip("TODO: RUSTPYTHON; flaky test")
@threading_helper.reap_threads
@threading_helper.requires_working_threading()
def test_unique_composite(self):
Expand Down Expand Up @@ -4493,7 +4492,6 @@ class Color(StrMixin, AllMixin, IntFlag):
self.assertEqual(Color.ALL.value, 7)
self.assertEqual(str(Color.BLUE), 'blue')

@unittest.skip("TODO: RUSTPYTHON; flaky test")
@threading_helper.reap_threads
@threading_helper.requires_working_threading()
def test_unique_composite(self):
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_httplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,6 @@ def test_local_good_hostname(self):
self.addCleanup(resp.close)
self.assertEqual(resp.status, 404)

@unittest.skip("TODO: RUSTPYTHON; Flaky on CI")
def test_local_bad_hostname(self):
# The (valid) cert doesn't validate the HTTPS hostname
import ssl
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_httpservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,6 @@ def test_large_content_length(self):
res = self.request('/cgi-bin/file7.py', 'POST', body, headers)
self.assertEqual(res.read(), b'%d %d' % (size, size) + self.linesep)

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_large_content_length_truncated(self):
with support.swap_attr(self.request_handler, 'timeout', 0.001):
for w in range(18, 65):
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_importlib/test_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def f():
self.assertEqual(len(results), NTHREADS)
return results

@unittest.skip("TODO: RUSTPYTHON; sometimes hangs")
def test_deadlock(self):
results = self.run_deadlock_avoidance_test(True)
# At least one of the threads detected a potential deadlock on its
Expand All @@ -109,7 +108,6 @@ def test_deadlock(self):
self.assertGreaterEqual(nb_deadlocks, 1)
self.assertEqual(results.count((True, True)), len(results) - nb_deadlocks)

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_no_deadlock(self):
results = self.run_deadlock_avoidance_test(False)
self.assertEqual(results.count((True, False)), 0)
Expand Down
3 changes: 0 additions & 3 deletions Lib/test/test_importlib/test_threaded_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def check_parallel_module_init(self, mock_os):
if verbose:
print("OK.")

@unittest.skip("TODO: RUSTPYTHON; flaky")
@support.bigmemtest(size=50, memuse=76*2**20, dry_run=False)
def test_parallel_module_init(self, size):
self.check_parallel_module_init()
Expand Down Expand Up @@ -247,15 +246,13 @@ def target():
__import__(TESTFN)
del sys.modules[TESTFN]

@unittest.skip("TODO: RUSTPYTHON; hang; Suspected cause of crashes in Windows CI - PermissionError: [WinError 32] Permission denied: \"C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\test_python_0cdrhhs_\\test_python_6340æ\"")
@support.bigmemtest(size=1, memuse=1.8*2**30, dry_run=False)
def test_concurrent_futures_circular_import(self, size):
# Regression test for bpo-43515
fn = os.path.join(os.path.dirname(__file__),
'partial', 'cfimport.py')
script_helper.assert_python_ok(fn)

@unittest.skip("TODO: RUSTPYTHON; hang")
@support.bigmemtest(size=1, memuse=1.8*2**30, dry_run=False)
def test_multiprocessing_pool_circular_import(self, size):
# Regression test for bpo-41567
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ def test_denial_of_service_prevented_int_to_str(self):
self.assertIn('conversion', str(err.exception))
self.assertLess(sw_fail_extra_huge.seconds, sw_convert.seconds/2)

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_denial_of_service_prevented_str_to_int(self):
"""Regression test: ensure we fail before performing O(N**2) work."""
maxdigits = sys.get_int_max_str_digits()
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ class L(list): pass
with self.assertRaises(TypeError):
(3,) + L([1,2])

@unittest.skip("TODO: RUSTPYTHON; hang")
def test_equal_operator_modifying_operand(self):
# test fix for seg fault reported in bpo-38588 part 2.
class X:
Expand All @@ -252,7 +251,6 @@ def __eq__(self, other):
list4 = [1]
self.assertFalse(list3 == list4)

@unittest.skip("TODO: RUSTPYTHON; hang")
def test_lt_operator_modifying_operand(self):
# See gh-120298
class evil:
Expand Down
3 changes: 0 additions & 3 deletions Lib/test/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ def remove_loop(fname, tries):
# based on os.fork existing because that is what users and this test use.
# This helps ensure that when fork exists (the important concept) that the
# register_at_fork mechanism is also present and used.
@unittest.skip("TODO: RUSTPYTHON; Flaky")
@support.requires_fork()
@threading_helper.requires_working_threading()
@skip_if_asan_fork
Expand Down Expand Up @@ -4109,8 +4108,6 @@ def _mpinit_issue121723(qspec, message_to_log):
# log a message (this creates a record put in the queue)
logging.getLogger().info(message_to_log)

@unittest.skip("TODO: RUSTPYTHON; flaky EOFError")
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; SemLock not implemented on Windows")
@skip_if_tsan_fork
@support.requires_subprocess()
def test_multiprocessing_queues(self):
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,6 @@ def test_bug_40736(self):

# gh-117594: The test is not slow by itself, but it relies on
# the absolute computation time and can fail on very slow computers.
@unittest.skip("TODO: RUSTPYTHON; flaky, improve perf")
@requires_resource('cpu')
def test_search_anchor_at_beginning(self):
s = 'x'*10**7
Expand Down
7 changes: 0 additions & 7 deletions Lib/test/test_regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,6 @@ def test_script_regrtest(self):
args = [*self.python_args, script, *self.regrtest_args, *self.tests]
self.run_tests(args)

@unittest.skip("TODO: RUSTPYTHON; flaky")
def test_module_test(self):
# -m test
args = [*self.python_args, '-m', 'test',
Expand All @@ -928,22 +927,19 @@ def test_module_regrtest(self):
*self.regrtest_args, *self.tests]
self.run_tests(args)

@unittest.skip("TODO: RUSTPYTHON; flaky")
def test_module_autotest(self):
# -m test.autotest
args = [*self.python_args, '-m', 'test.autotest',
*self.regrtest_args, *self.tests]
self.run_tests(args)

@unittest.skip("TODO: RUSTPYTHON; flaky")
def test_module_from_test_autotest(self):
# from test import autotest
code = 'from test import autotest'
args = [*self.python_args, '-c', code,
*self.regrtest_args, *self.tests]
self.run_tests(args)

@unittest.skip("TODO: RUSTPYTHON; flaky")
def test_script_autotest(self):
# Lib/test/autotest.py
script = os.path.join(self.testdir, 'autotest.py')
Expand Down Expand Up @@ -2033,7 +2029,6 @@ def test_cleanup(self):
for name in names:
self.assertFalse(os.path.exists(name), name)

@unittest.skip("TODO: RUSTPYTHON; flaky")
@unittest.skipIf(support.is_wasi,
'checking temp files is not implemented on WASI')
def test_leak_tmp_file(self):
Expand Down Expand Up @@ -2185,11 +2180,9 @@ def test_randint(self):
def test_random_seed(self):
self._check_random_seed(run_workers=False)

@unittest.skip("TODO: RUSTPYTHON; flaky")
def test_random_seed_workers(self):
self._check_random_seed(run_workers=True)

@unittest.skip("TODO: RUSTPYTHON; flaky")
def test_python_command(self):
code = textwrap.dedent(r"""
import sys
Expand Down
8 changes: 0 additions & 8 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -7066,14 +7066,6 @@ class SendfileUsingSendfileTest(SendfileUsingSendTest):
def meth_from_sock(self, sock):
return getattr(sock, "_sendfile_use_sendfile")

@unittest.skip("TODO: RUSTPYTHON; os.sendfile count parameter not handled correctly; flaky")
def testCount(self):
return super().testCount()

@unittest.skip("TODO: RUSTPYTHON; os.sendfile count parameter not handled correctly; flaky")
def testWithTimeout(self):
return super().testWithTimeout()


@unittest.skipUnless(HAVE_SOCKET_ALG, 'AF_ALG required')
class LinuxKernelCryptoAPI(unittest.TestCase):
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_strtod.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def test_short_halfway_cases(self):
digits *= 5
exponent -= 1

@unittest.skip("TODO: RUSTPYTHON; fails on debug mode, flaky in release mode")
def test_halfway_cases(self):
# test halfway cases for the round-half-to-even rule
for i in range(100 * TEST_SIZE):
Expand Down Expand Up @@ -213,7 +212,6 @@ def test_bigcomp(self):
s = '{}e{}'.format(digits, exponent)
self.check_strtod(s)

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_parsing(self):
# make '0' more likely to be chosen than other digits
digits = '000000123456789'
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,6 @@ def kill_p2():
p1.stdout.close()
p2.stdout.close()

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_close_fds(self):
fd_status = support.findfile("fd_status.py", subdir="subprocessdata")

Expand Down Expand Up @@ -3183,7 +3182,6 @@ def test_close_fds_when_max_fd_is_lowered(self):
# descriptor of a pipe closed in the parent process is valid in the
# child process according to fstat(), but the mode of the file
# descriptor is invalid, and read or write raise an error.
@unittest.skip("TODO: RUSTPYTHON; flaky test")
@support.requires_mac_ver(10, 5)
def test_pass_fds(self):
fd_status = support.findfile("fd_status.py", subdir="subprocessdata")
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,6 @@ def test_cleanup_with_symlink_to_a_directory(self):
d2.cleanup()

@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; flaky, sometimes pollute env on CI")
@unittest.expectedFailureIf(sys.platform in ('android', 'linux'), "TODO: RUSTPYTHON; FileNotFoundError: [Errno 2] No such file or directory: '<LONG_PATH>'")
@os_helper.skip_unless_symlink
def test_cleanup_with_symlink_modes(self):
# cleanup() should not follow symlinks when fixing mode bits (#91133)
Expand Down
14 changes: 0 additions & 14 deletions Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ def background_thread(evt):
self.assertEqual(out, b'')
self.assertEqual(err, b'')

@unittest.skip("TODO: RUSTPYTHON; flaky")
@skip_unless_reliable_fork
def test_is_alive_after_fork(self):
# Try hard to trigger #18418: is_alive() could sometimes be True on
Expand Down Expand Up @@ -749,7 +748,6 @@ def test_main_thread_after_fork(self):
"main ident True\n"
"current is main True\n")

@unittest.skip("TODO: RUSTPYTHON; flaky; process timeout after fork")
@skip_unless_reliable_fork
@unittest.skipUnless(hasattr(os, 'waitpid'), "test needs os.waitpid()")
def test_main_thread_after_fork_from_nonmain_thread(self):
Expand Down Expand Up @@ -1470,7 +1468,6 @@ def test_2_join_in_forked_process(self):
"""
self._run_and_join(script)

@unittest.skip("TODO: RUSTPYTHON; flaky test")
@skip_unless_reliable_fork
def test_3_join_in_forked_from_thread(self):
# Like the test above, but fork() was called from a worker thread
Expand Down Expand Up @@ -1571,7 +1568,6 @@ def thread1():
self.assertEqual(out.strip(), b"OK")
self.assertEqual(rc, 0)

@unittest.skip("TODO: RUSTPYTHON; - flaky, parking_lot mutex not fork-safe")
@skip_unless_reliable_fork
def test_reinit_tls_after_fork(self):
# Issue #13817: fork() would deadlock in a multithreaded program with
Expand Down Expand Up @@ -1852,7 +1848,6 @@ def test_releasing_unacquired_lock(self):
lock = threading.Lock()
self.assertRaises(RuntimeError, lock.release)

@unittest.skip("TODO: RUSTPYTHON; flaky test")
@requires_subprocess()
def test_recursion_limit(self):
# Issue 9670
Expand Down Expand Up @@ -2236,10 +2231,6 @@ def __init__(self, a, *, b) -> None:
CustomRLock(1, b=2)
self.assertEqual(warnings_log, [])

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_different_thread(self):
return super().test_different_thread()

class EventTests(lock_tests.EventTests):
eventtype = staticmethod(threading.Event)

Expand All @@ -2250,10 +2241,6 @@ class ConditionAsRLockTests(lock_tests.RLockTests):
def test_recursion_count(self):
self.skipTest("Condition does not expose _recursion_count()")

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_different_thread(self):
return super().test_different_thread()

class ConditionTests(lock_tests.ConditionTests):
condtype = staticmethod(threading.Condition)

Expand Down Expand Up @@ -2413,7 +2400,6 @@ def check_interrupt_main_noerror(self, signum):
# Restore original handler
signal.signal(signum, handler)

@unittest.skip("TODO: RUSTPYTHON; flaky")
@requires_gil_enabled("gh-118433: Flaky due to a longstanding bug")
def test_interrupt_main_subthread(self):
# Calling start_new_thread with a function that executes interrupt_main
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_threading_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def target(local, weaklist):

class BaseLocalTest:

@unittest.skip("TODO: RUSTPYTHON; flaky test")
def test_local_refs(self):
self._local_refs(20)
self._local_refs(50)
Expand Down
10 changes: 10 additions & 0 deletions crates/host_env/src/posix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ pub fn chroot(path: &Path) -> std::io::Result<()> {
nix::unistd::chroot(path).map_err(std::io::Error::from)
}

#[cfg(all(unix, not(target_os = "redox")))]
pub fn fchmodat(dirfd: i32, path: &CStr, mode: libc::mode_t, flags: i32) -> std::io::Result<()> {
let ret = unsafe { libc::fchmodat(dirfd, path.as_ptr(), mode, flags) };
if ret == 0 {
Ok(())
} else {
Err(std::io::Error::last_os_error())
}
}

#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "netbsd"))]
pub fn lchmod(path: &CStr, mode: libc::mode_t) -> std::io::Result<()> {
unsafe extern "C" {
Expand Down
Loading
Loading