mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
tests that unmounting succeeds when file handles are open
Summary: Add some skipped tests that illustrate that Eden cannot shut down when file handles are open. They will be enabled later in this stack as the root cause is fixed.. Reviewed By: strager Differential Revision: D13287587 fbshipit-source-id: cd8d79896127676853c183bb4b86c0d586ce511e
This commit is contained in:
parent
1e007b63cc
commit
bfbf3bfe37
@ -9,6 +9,7 @@
|
||||
|
||||
import os
|
||||
from typing import Set
|
||||
import unittest
|
||||
|
||||
from .lib import testcase
|
||||
|
||||
@ -91,3 +92,21 @@ class MountTest(testcase.EdenRepoTest):
|
||||
self.assertTrue(self.eden.in_proc_mounts(self.mount))
|
||||
entries = sorted(os.listdir(self.mount))
|
||||
self.assertEqual([".eden", "adir", "bdir", "hello", "slink"], entries)
|
||||
|
||||
@unittest.skip("not passing yet")
|
||||
def test_unmount_succeeds_while_file_handle_is_open(self) -> None:
|
||||
fd = os.open(os.path.join(self.mount, "hello"), os.O_RDWR)
|
||||
# This test will fail or time out if unmounting times out.
|
||||
self.eden.run_cmd("unmount", self.mount)
|
||||
# Surprisingly, os.close does not return an error when the mount has
|
||||
# gone away.
|
||||
os.close(fd)
|
||||
|
||||
@unittest.skip("not passing yet")
|
||||
def test_unmount_succeeds_while_dir_handle_is_open(self) -> None:
|
||||
fd = os.open(self.mount, 0)
|
||||
# This test will fail or time out if unmounting times out.
|
||||
self.eden.run_cmd("unmount", self.mount)
|
||||
# Surprisingly, os.close does not return an error when the mount has
|
||||
# gone away.
|
||||
os.close(fd)
|
||||
|
Loading…
Reference in New Issue
Block a user