mirror of
https://github.com/facebook/sapling.git
synced 2025-01-05 20:28:24 +03:00
Always run doctor checks in 'eden rage'
Summary: If edenfs is not running or is unhealthy, 'eden rage' does not run 'eden doctor'. This means 'eden rage' does not include helpful output such as ~/local/.eden/clients/* being on NFS, or the Linux kernel version being unsupported. Make 'eden rage' run 'eden doctor' regardless of the health of edenfs. Reviewed By: simpkins Differential Revision: D13633381 fbshipit-source-id: 2439057ba7a7bbe5041991ddc4ede256e86634f3
This commit is contained in:
parent
13c2d03331
commit
ad6c2d5b66
@ -36,10 +36,8 @@ def print_diagnostic_info(instance: EdenInstance, out: IO[bytes]) -> None:
|
||||
debug_mod.do_buildinfo(instance, out)
|
||||
out.write(b"uptime: ")
|
||||
debug_mod.do_uptime(instance, out)
|
||||
print_eden_doctor_report(instance, out)
|
||||
else:
|
||||
out.write(b"Eden is not running. Some debug info will be omitted.\n")
|
||||
|
||||
print_eden_doctor_report(instance, out)
|
||||
print_tail_of_log_file(instance.get_log_path(), out)
|
||||
print_running_eden_process(out)
|
||||
|
||||
|
@ -23,7 +23,20 @@ class RageTest(testcase.EdenRepoTest):
|
||||
def test_rage_output(self) -> None:
|
||||
output = self.eden.run_cmd("rage", "--stdout")
|
||||
logging.info(f"Rage output:\n{output}")
|
||||
self.assert_output_includes_unconditional_checks(output)
|
||||
self.assertRegex(output, r"\nbuild_package_release\s*:")
|
||||
self.assertRegex(output, r"\nbuild_package_version\s*:")
|
||||
self.assertRegex(output, r"\nuptime\s*:")
|
||||
self.assertIn(f"\nChecking {self.mount}\n", output)
|
||||
self.assertIn("edenfs memory usage", output)
|
||||
|
||||
def test_rage_output_with_stopped_daemon(self) -> None:
|
||||
self.eden.shutdown()
|
||||
output = self.eden.run_cmd("rage", "--stdout")
|
||||
logging.info(f"Rage output:\n{output}")
|
||||
self.assert_output_includes_unconditional_checks(output)
|
||||
|
||||
def assert_output_includes_unconditional_checks(self, output: str) -> None:
|
||||
# Check to make sure that various important sections of information
|
||||
# are present in the rage output.
|
||||
#
|
||||
@ -34,14 +47,9 @@ class RageTest(testcase.EdenRepoTest):
|
||||
self.assertRegex(output, r"\nHostname\s*:")
|
||||
# Allow the test to succeed even if the fb-eden RPM is not installed
|
||||
self.assertRegex(output, r"\n(Rpm Version\s*:|Error getting the Rpm version)")
|
||||
self.assertRegex(output, r"\nbuild_package_release\s*:")
|
||||
self.assertRegex(output, r"\nbuild_package_version\s*:")
|
||||
self.assertRegex(output, r"\nuptime\s*:")
|
||||
self.assertIn("\neden doctor --dry-run", output)
|
||||
self.assertIn(f"\nChecking {self.mount}\n", output)
|
||||
self.assertIn("\nMost recent Eden logs:\n", output)
|
||||
self.assertIn("\nList of running Eden processes:\n", output)
|
||||
self.assertIn("\nList of mount points:\n", output)
|
||||
self.assertIn(f"\nMount point info for path {self.mount}:\n", output)
|
||||
self.assertIn("edenfs memory usage", output)
|
||||
self.assertIn(f"{self.mount}\n", output)
|
||||
|
Loading…
Reference in New Issue
Block a user