Skip to content

Commit e094382

Browse files
ViniGupta08facebook-github-bot
authored andcommitted
Limit eden stale version check to only windows platform
Summary: As per the discussion in this doc - https://docs.google.com/document/d/1fTxlasZfWv58iVhRr6Um3nSIOk4R0e4J6lxsCzG4W9E/edit?usp=sharing we should limit edenfs stale version check to Windows only, The only cases of an old eden version on non-Windows would be: 1) repeated failed graceful restart (we get alerts for this) 2) no chef run in a while (there is another check for that in this tool) and both cases are already handled Reviewed By: kavehahmadi60 Differential Revision: D75172490 fbshipit-source-id: a0dca761eb2519c155773258d748c925ae4f476e
1 parent 7bf0ad2 commit e094382

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

eden/fs/cli/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,8 @@ def is_eden_up_to_date(self) -> bool:
13541354
"""Checks if running version is newer than a pre-configured threshold.
13551355
If provided threshold is 0, the check is skipped and returns True."""
13561356
if (
1357-
self.running_version_days_threshold != 0
1357+
sys.platform == "win32"
1358+
and self.running_version_days_threshold != 0
13581359
and self.version_info.ages_deltas is not None
13591360
and self.version_info.ages_deltas >= self.running_version_days_threshold
13601361
):

eden/fs/cli/test/health_report_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import argparse
1010
import json
1111
import os
12+
import sys
1213

1314
import tempfile
1415
import time
@@ -73,6 +74,8 @@ def get_version_age(version_str: str) -> int:
7374
True, # is dev version
7475
)
7576

77+
windows_only: bool = sys.platform == "win32"
78+
7679

7780
class HealthReportTest(unittest.TestCase, TemporaryDirectoryMixin):
7881
def setup(self) -> typing.Tuple[MagicMock, argparse.Namespace, str]:
@@ -240,6 +243,7 @@ def test_health_report_notify_eden_not_running(
240243

241244
self.assertEqual(result, 1)
242245

246+
@unittest.skipUnless(windows_only, "Test only runs on Windows")
243247
@patch("eden.fs.cli.config.EdenInstance.get_mount_paths")
244248
@patch("eden.fs.cli.util.get_chef_log_path")
245249
@patch("eden.fs.cli.doctor.facebook.check_x509.find_x509_path")
@@ -283,6 +287,7 @@ def test_health_report_check_for_stale_eden_version_prompt_error(
283287
)
284288
self.assertEqual(result, 1)
285289

290+
@unittest.skipUnless(windows_only, "Test only runs on Windows")
286291
@patch("eden.fs.cli.config.EdenInstance.get_mount_paths")
287292
@patch("eden.fs.cli.config.EdenInstance.get_config_int")
288293
@patch("eden.fs.cli.util.get_chef_log_path")
@@ -326,6 +331,7 @@ def test_health_report_stale_version_check_disabled(
326331
HealthReportCmd.error_codes,
327332
)
328333

334+
@unittest.skipUnless(windows_only, "Test only runs on Windows")
329335
@patch("eden.fs.cli.config.EdenInstance.get_mount_paths")
330336
@patch("eden.fs.cli.util.get_chef_log_path")
331337
@patch("eden.fs.cli.doctor.facebook.check_x509.find_x509_path")

0 commit comments

Comments
 (0)