Commit Graph

600 Commits

Author SHA1 Message Date
Xavier Deguillard
42fb95adc2 integration: write files to the repo in binary mode
Summary:
In text mode, Python will use '\r\n' as line endings instead of '\n' on
Windows. This has the negative side effect of making some tests fails due to
the file content not being exactly what is being written.

Reviewed By: fanzeyi

Differential Revision: D21944456

fbshipit-source-id: f7f271e2ef9e2f21bd78c76233e644ce411b63df
2020-06-15 15:10:20 -07:00
Genevieve Helsel
ca1da512bf store force restart action as its own flag
Summary: In its current state, FORCE is a restart mode that cannot be combined with other modes (specifically `graceful`). Removing this coupling from `force` will allow us to at first attempt a graceful restart, but if the daemon is not healthy, then do a force restart, all within one call.

Reviewed By: wez

Differential Revision: D21873166

fbshipit-source-id: 079a777ff6e7b219198cbef15335244b9865f5f3
2020-06-11 17:40:51 -07:00
Chad Austin
597c209fa1 disallow warnings in integration tests
Summary:
Unawaited coroutines are pernicious and not errors by default. In
advance of enabling asynchronous tests, fail our tests when Python
warnings are shown.

We record warnings and report them after the test body instead of
enabling an "error" warning filter because exceptions thrown by
finalizers are silently swallowed, and most important warnings occur
during finalization.

Reviewed By: genevievehelsel

Differential Revision: D21955210

fbshipit-source-id: b1fc52ddfa9f9befbde6800f85f090862af0ef15
2020-06-10 23:23:34 -07:00
Chad Austin
e1e4bdee40 add a (failing) test of binary blob contents over thrift
Summary:
Add a disabled test that illustrates that binary data fails to
serialize between edenfs and the CLI with the current Thrift
implementation.

Reviewed By: fanzeyi

Differential Revision: D21890379

fbshipit-source-id: 725e99751e1d62c39f4059ec0f1197857c47e3b4
2020-06-10 19:29:42 -07:00
Chad Austin
7e4835f677 rename eden.thrift Python module to eden.thrift.legacy
Summary:
The Python 2-and-3 Thrift API is sort of deprecated and does not
handle binary data in `binary` fields. In advance of migrating to the
modern Python 3 API, remane eden.thrift to eden.thrift.legacy.

Reviewed By: fanzeyi

Differential Revision: D21889697

fbshipit-source-id: a745ee8977999acbfb383a4edebe81d8deb1734e
2020-06-10 19:29:42 -07:00
Chad Austin
11d569b04d refactor EdenClient construction
Summary:
I am planning to start migrating Eden's CLI to the new Python 3 Thrift
implementation. In preparation, slightly clean up the interface and
implementation of our Python 2 Thrift wrapper.

Reviewed By: genevievehelsel

Differential Revision: D21854539

fbshipit-source-id: d398dd3f324c12288871cf0c9db41e64ed4cf7ed
2020-06-10 19:29:23 -07:00
Chad Austin
3b04c02b29 fix flaky integration tests
Summary:
Under heavy parallelism or system load, our tests could trigger
short-ish timeouts and cause tests to flake. The stats test in
particular often failed in continuous integration. It looks like
opening a unix domain Thrift socket early and holding onto it can
cause it to sometimes hit ThriftServer's default idle timeout of 60
seconds, which results in the test failing with BrokenPipeError
(EPIPE).

Reviewed By: simpkins

Differential Revision: D21780023

fbshipit-source-id: 7e8838429475c2a322d836b9a497411199948cce
2020-05-29 11:49:37 -07:00
Xavier Deguillard
0cb5ceedfe unify the EdenMain code on Windows
Summary:
Update EdenFS on Windows to use EdenMain.cpp, the same as on POSIX.

This reduces the amount of code divergence, and also brings several
improvements to Windows: exposing version information over fb303, support for
dynamically changing logging configuration over fb303, etc.

Reviewed By: simpkins

Differential Revision: D21332569

fbshipit-source-id: dd2da7c385e96f65fc3927511c9f84b96bec9e2b
2020-05-28 09:01:03 -07:00
generatedunixname89002005307016
f9358e566a suppress errors in eden - batch 1
Summary:
This diff is auto-generated to upgrade the Pyre version and suppress errors in eden. The upgrade will affect Pyre local configurations in the following directories:
```
eden
```

Differential Revision: D21687853

fbshipit-source-id: baf0d9bc33f86da63ea289690faca6cf4d566588
2020-05-21 19:32:35 -07:00
Xavier Deguillard
cd92c10363 integration: symlinks are not supported on Windows
Summary:
Now that regular users can create symlinks, a handful of tests were failing
due to the symlink call no longer raising an exception. For now, let's always
consider that symlinks aren't supported on Windows.

Reviewed By: fanzeyi

Differential Revision: D21664213

fbshipit-source-id: c55a99d1cb92e68b9861701b5517b1d5db2d40c6
2020-05-20 13:11:10 -07:00
Shannon Zhu
096b35c70b Convert type check targets in eden to use configuration
Summary:
Migrating buck integration to use configurations, which is more performant and is the primary supported way to run Pyre.
Mypy is no longer supported at Facebook, so mypy buck integration is covered in this migration as well.

Configuration target automatically expanded to include all subtargets, expanding type coverage while introducing no more than 2 fixmes per file.

Reviewed By: dkgi

Differential Revision: D21474723

fbshipit-source-id: 2501af8250b4998fe331350b80c9dc8b4ba2dd1a
2020-05-08 15:24:57 -07:00
Chad Austin
c4db2f39a9 remove some internal uses of the term 'client'
Summary:
Our use of the term "client" to refer to a checkout is
deprecated. Rename some internal functions that use the term client.

Reviewed By: simpkins

Differential Revision: D21395159

fbshipit-source-id: fa96ba593f53b493e5ae816fa686f333a132c232
2020-05-07 22:08:10 -07:00
Adam Simpkins
13a8f17325 de-blacklist most of the hg status related tests on Windows
Summary: All of the tests in hg/status_test.py pass except for these 3.

Reviewed By: genevievehelsel

Differential Revision: D21410570

fbshipit-source-id: cf9a87ce0f025860c1e95927a780757fda6801ad
2020-05-07 16:41:30 -07:00
Adam Simpkins
ccdbc2279b update most of the integration/basic_test.py tests to work on Windows
Summary:
- If we fail to create symlinks ignore this error on Windows
- Using a file as a directory produces an ENOENT error instead of ENOTDIR
  on Windows.
- Deal with some issues around CR -> CRLF translation when writing files in
  non-binary mode on Windows.
- Move several POSIX-specific tests out into a separate test class.

Reviewed By: wez

Differential Revision: D21214598

fbshipit-source-id: 587a755bd06990bf88d26017254a69ff8869edbc
2020-05-07 16:41:30 -07:00
Adam Simpkins
54af4a5770 update can_run_eden() to check for ProjectedFSLib.dll on Windows
Summary:
On Windows we can only run EdenFS if ProjectedFSLib.dll is available.  It
turns out that some Windows systems have ProjectedFSLib.lib available, so we
can build `edenfs.exe`, but are missing ProjectedFSLib.dll, so we cannot
actually run it.

Reviewed By: wez

Differential Revision: D21443255

fbshipit-source-id: 6396fce8bd71adc0695468a2df3fd5f584909138
2020-05-07 16:41:30 -07:00
Shannon Zhu
83dc7b9129 Custom pyre upgrade for eden
Summary:
Addressing issues simpkins brought up on D21207287 when we upgraded and introduced some pyre bugs.

Temporarily upgrading just this project, once we resolve some sandcastle capacity issues we'll release this via another global upgrade in fbcode.

Reviewed By: simpkins

Differential Revision: D21316793

fbshipit-source-id: f0c79f53d97f7182e7d8fe6e081c58ef53ce0c9a
2020-05-04 21:19:20 -07:00
Adam Simpkins
c0fb9cea2d enable all integration test sources in CMake builds
Summary:
Previously we only included `basic_test.py` and `hg/status_test.py` in the
integration tests during CMake-based builds.  This updates the code to now
include all of the test files, with just a few exclusions based on platform
type and what dependencies were available at build time.

Reviewed By: wez

Differential Revision: D21239912

fbshipit-source-id: b8826d249a6323ac3bcc555c9ceba54a4cbcfde9
2020-05-04 11:46:09 -07:00
Adam Simpkins
a755d9e979 blacklist some integration tests on non-RedHat Linux distributions
Summary:
10 of the integration tests fail on Ubuntu.  For now simply blacklist them
from running on non-RedHat-based distributions.

Reviewed By: wez

Differential Revision: D21332629

fbshipit-source-id: 3fadb74bb31e89092177afaa01ddc7f6bcd0f9de
2020-05-04 11:46:09 -07:00
Adam Simpkins
ea7460f2d3 apply the integration test case blacklist to some more tests
Summary:
Add a new IntegrationTestCase base class that checks the test blacklist during
`setUp()`, and update a few remaining test classes that did not derive from
`EdenTestCase` to derive from this.

Also drop the method name argument from the `skip_test_if_blacklisted()`
function, since we can get this from the existing test case argument.

Reviewed By: genevievehelsel

Differential Revision: D21340539

fbshipit-source-id: d4fc125f119d74ab923c2cc3c9070b86c582c87e
2020-05-04 11:46:09 -07:00
Adam Simpkins
f390948707 fix the UserInfoTest on Ubuntu
Summary:
Run `env` as `/usr/bin/env` instead of `/bin/env`
This command is typically installed in `/usr/bin`.  Recent RedHat releases
replaced `/bin/ with a symlink to `/usr/bin`, allowing this command to work
when invoked as `/bin/env`, but this isn't true on all distributions, such as
Ubuntu.

Reviewed By: chadaustin

Differential Revision: D21340540

fbshipit-source-id: d7588f8c90e9a86a0cb31fd3ab3a9067aa6e79ea
2020-05-04 11:46:08 -07:00
Shannon Zhu
0b93429dc1 Convert type check targets in eden to use configuration
Summary:
D21316793 is blocked from landing because there are a few targets in eden that are running pyre via buck targets integration.

We can't do custom version overrides for projects that are using a mix of local configurations and buck integration, because buck doesn't provide an interface for setting the equivalent pyre version override.

We're moving away from buck targets integration for pyre across the board, and I've run a codemod over the project to clean up all of the buck typing integration (including some residual mypy) as well as updated type ignores / fixmes accordingly.

Let me know if you have any concerns; upon skimming it looks like most changes are either converting `type: ignore`s into fixmes, or removing `type: ignores`.

Reviewed By: dkgi

Differential Revision: D21343093

fbshipit-source-id: 5ee1436377eb526c0a679fb821c42e07cbca52a5
2020-05-02 21:16:55 -07:00
Chad Austin
ec00e91309 disallow setting suid, sgid, and sticky bits
Summary:
FUSE_HANDLE_KILLPRIV expects that any write() call is handled by
clearing the setuid and setgid bits in the userspace. To avoid
implementing that behavior, disallow setting setuid or setgid in the
first place.

Reviewed By: xavierd

Differential Revision: D21333703

fbshipit-source-id: eb084ee8b00afe74c0da26e41c32c2cb742723da
2020-04-30 15:18:35 -07:00
Adam Simpkins
8392001e38 update the systemd-related integration tests to work on Ubuntu
Summary:
The systemd binary is installed in a different location on Debian-based
distributions (e.g., Ubuntu) from RedHat-based distributions.  Update the
integration tests to look in both places.

Reviewed By: wez

Differential Revision: D21297591

fbshipit-source-id: 67e5a698080205b8624c1f38aa49e75c20b6a28c
2020-04-29 23:12:37 -07:00
Adam Simpkins
0400e99d09 update the integration tests to guess at CMAKE_SOURCE_DIR
Summary:
Our CMakeLists.txt file requests `ctest` to pass in a `CMAKE_SOURCE_DIR`
environment variable when running our integration tests via `ctest`.  However
if a developer manually invokes the test binary this environment variable may
not be set.

For convenience, this updates the code to try looking at the default location
where getdeps will have put the source relative to the build directory (at
least for internal builds using shipit-converted fbsource sources).

Reviewed By: wez

Differential Revision: D21307807

fbshipit-source-id: d747c50d79d2d378721b68b18c256d5363e41f26
2020-04-29 18:50:34 -07:00
Adam Simpkins
ea59a68521 improve finding the system hgrc during CMake-based integration tests
Summary:
Update the integration tests to attempt to find the Mercurial config files
from the source directory even in CMake-based builds.  This directory will be
available when doing an internal build from fbsource via getdeps.py

If this directory isn't present (e.g., on a build from the github repository)
we will still fall back to using the Mercurial configuration files installed
on the system.  In that case I did update the code to use the correct system
configuration path on Windows.

Reviewed By: wez

Differential Revision: D21307808

fbshipit-source-id: 917ba5e8548fed999fb06a29324be125cec83cac
2020-04-29 18:50:34 -07:00
Adam Simpkins
1c3eb54e21 remove the requirement that edenfs must be invoked with --edenfs
Summary:
Remove the requirement that the `--edenfs` argument flag must be passed in
when invoking the `edenfs` daemon.

This flag was added in D12927803 to help provide a better error message if
users accidentally ran `edenfs` when they really mean to run `edenfsctl`.
However, this shouldn't really be a major problem any more: on Linux and Mac
we now install `edenfs` in a `libexec` subdirectory instead of `bin`, so it
should not be in most user's `$PATH` by default any more.  Additionally we
also verify that no other unexpected arguments have been supplied.  Prior to
D12927803 the `edenfs` binary would ignore unexpected arguments, making the
error messages more confusing when users tried to run it with `edenfsctl`
subcommand arguments.

One motivation for changing this now is that the Windows version of `edenfs`
does not require this flag, and it is desirable to remove this behavior
discrepancy.  Rather than making this flag required on Windows it seems fine
to just drop the requirement on Mac & Linux.

Reviewed By: wez

Differential Revision: D21297159

fbshipit-source-id: e24bd694dadc036cd31dead287ae2c1184747822
2020-04-29 17:55:34 -07:00
Adam Simpkins
f48674b1df update the service test cases to skip when appropriate
Summary:
Update the tests that derive from `ServiceTestCaseBase` to honor the test
blacklist, and to also skip if we cannot run the `fake_edenfs` utility.  This
latter check primarily fails when we cannot run `sudo` non-interactively
without a password prompt.

Most of the other tests were already honoring blacklist through the
`EdenTestCase` base class, but `ServiceTestCaseBase` does not derive from
`EdenTestCase`.

Reviewed By: wez

Differential Revision: D21297160

fbshipit-source-id: 5044e9939bbe487c09aa96021166c95f02fb376e
2020-04-29 17:55:34 -07:00
Adam Simpkins
c55781c666 move UserInfo to eden/fs/utils/
Summary:
Move the `UserInfo` code from `fuse/privhelper` to `utils`, and also unify the
POSIX and Windows implementations of this class.

This code was originally put in the `fuse/privhelper` directory since it was
written at the same time as the privhelper.  However, it's really a
lower-level library that doesn't depend on FUSE or any of the other code in
the `fuse/` subdirectory.

Reviewed By: wez

Differential Revision: D21296594

fbshipit-source-id: f58682f6ce86bba0328472c491bb4c0dc3370319
2020-04-29 17:21:12 -07:00
Katie Mancini
48804631f7 expose number pending fuse requests
Summary:
This sets up the counters that will allow us to expose the number
of pending FUSE requests in Eden top.

As D20846826 mentions adding metrics for FUSE request gives
visibility into fuse requests and overall health of eden.

This provides more insight beyond the metrics for live FUSE requests
since it shows the kernels view of FUSE requests. Looking at the difference
between the number of pending and live request, can identify issues
that arise at the interface between eden and FUSE and monitor how
quickly fuse workers are processing requests.

**note**: this is only for linux since macos has no equivalent to
`/sys/fs/fuse/connections`

Reviewed By: chadaustin

Differential Revision: D21074489

fbshipit-source-id: c0951f0dfd4fa764be28d8686d08cd0dd807db37
2020-04-28 13:28:01 -07:00
Genevieve Helsel
cfb64a0a2d clean up EdenMount destruction process
Summary:
In the past, if an EdenMount got stuck while shutting down (inodes still referenced), the EdenMount would already be removed from the server's `mounPoint's` map while stuck. This resulted in `eden list` showing that the mount was not mounted, and then if we tried to remount the mount, we'd get a confusing error message about the not being able to grab the overlay lock. This also made it so if we tried to attach with gdb, or if we core dumped and tried to look at the data, we wouldn't be able to examine the object.

Instead, we should only remove the mount from the `mounPoints_` map after it has completely been shutdown. This will allow us to get better signal on the state of the mount (it will be in the `SHUTTING_DOWN` state in `eden list` instead of `(not mounted)`) and it will allow us to better debug these situations (where a mount is stuck shutting down) since we can get more information about the mount that is in this state.

Reviewed By: simpkins

Differential Revision: D21211544

fbshipit-source-id: 97ff11df67d0a80f47cf6b9f563876e17bd76622
2020-04-28 12:44:12 -07:00
Adam Simpkins
e193085594 some ctypes-related portability improvements in the integration tests
Summary:
Update `integration/lib/linux.py` to use `ctypes` to call `statfs`, instead of
running `/bin/stat` and parsing the output.  This allows this test code to
work even on systems that do not have `/bin/stat` (e.g., on Ubuntu this is
installed at `/usr/bin/stat`).

Also update the usage of ctypes in the `mmap.py` test file to allow this file
to be imported successfully on Mac OS X.

Reviewed By: xavierd

Differential Revision: D21273385

fbshipit-source-id: c2173758f8ea67cde2a68e57827acc5f73b63179
2020-04-28 12:11:51 -07:00
Adam Simpkins
5470190bf3 update one of the rebase tests to explicitly use non-in-memory update
Summary:
Update the `test_rebase_commit_with_independent_folder()` test to explicitly
disable in-memory updates.  The in-memory update code ends up changing the
number of update operations performed (it skips the initial and final update),
causing one of the assertions in this test to fail.

Reviewed By: xavierd

Differential Revision: D21271902

fbshipit-source-id: 3e40adce5fac1c851c8f277d2209d48a19deed55
2020-04-28 12:11:51 -07:00
Adam Simpkins
c13f0ac5f7 update the usage of pexpect to work on Windows
Summary:
Update the integration test code that uses pexpect to use the more modern
pexpect APIs.  The top-level `pexpect.spawn()` function is considered legacy
now, and is only provided for backwards compatibility on Unix platforms.

Reviewed By: wez

Differential Revision: D21214640

fbshipit-source-id: 941da5435c4f8afaf22e8053f4c344175d7b1a7f
2020-04-24 14:48:05 -07:00
Adam Simpkins
cadcd0ab39 enable building the integration helper tools in the CMake build
Summary:
Enable building fake_edenfs.cpp and TakeoverTool.cpp in the CMake build.

This includes a few changes to get `fake_edenfs.cpp` closer to building on
Windows, but at the moment it still does not fully build since the
`StartupLogger` is currently not compiled on Windows.

TakeoverTool.cpp is specific to the graceful restart tests, and doesn't make
sense to ever build on Windows.

Reviewed By: wez

Differential Revision: D21214614

fbshipit-source-id: a7a8306ea3f69579fa02bd3753a66d3095ea004a
2020-04-24 14:48:05 -07:00
Adam Simpkins
cb5b9fefd7 tweaks to update the integration tests to allow running on Windows
Summary:
Previously none of the integration tests ran on Windows, as they checked for
the presence of `/dev/fuse` first, and would skip the test if it was not
present.

This updates the tests to allow running on Windows, and updates the
`find_executables.py` code to find the executables properly on Windows.

Reviewed By: wez

Differential Revision: D17733621

fbshipit-source-id: a8bf4e5138f9ea6c9b040814dd68fc64228961de
2020-04-24 14:14:15 -07:00
Adam Simpkins
6500f94127 avoid running systemd-related tests when systemd is not supported
Summary:
systemd is Linux-specific, so it does not make sense to try and run these
tests on Linux and Mac.  Additionally, the pystemd module currently used by
the edenfsctl CLI is not currently open source, and therefore only works in
our internal Linux builds.

This updates the integration test code to only include systemd-related tests
if we are actually in an environment where we support systemd.

Reviewed By: wez

Differential Revision: D21084095

fbshipit-source-id: fb6c9a066d9dcb741bddf3cdcf9decdb763a1d05
2020-04-23 15:06:32 -07:00
Shannon Zhu
6ec7546cab Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: grievejia

Differential Revision: D21207287

fbshipit-source-id: ab82cf81690cb847bd130ff3448345f5a0ea19af
2020-04-23 12:09:39 -07:00
Adam Simpkins
1e8e8b05de clean up parts of the start and clone integration tests
Summary:
Several of the tests started edenfs of fake_edenfs processes and didn't kill
them at the end of the test.  This adds proper cleanup functions to try and
kill these processes when the test exits.

This also eliminates using pexpect in these tests, since it isn't actually
necessary here.

Reviewed By: wez

Differential Revision: D21084096

fbshipit-source-id: 4e92a99a5c398d4a78830ac51507ba34d7a6c0b1
2020-04-22 15:02:42 -07:00
Adam Simpkins
c763e922a2 kill off some of the integration test mixin classes
Summary:
This updates the various systemd-related tests to use EdenTestCaseBase,
and allows us to delete the EnvironmentVariableMixin and
SystemdUserServiceManagerMixin classes.

The main goal of this clean-up is to make it easier to consolidate most of the
systemd-related code into just a few locations, so that we can more easily
disable the systemd-related tests in build environments where systemd is not
supported.

Reviewed By: wez

Differential Revision: D21084098

fbshipit-source-id: d5e05254c689c28751fe48d2dc38d722c7e77ed3
2020-04-22 15:02:42 -07:00
Adam Simpkins
72f6ada7c2 add a new EdenTestCaseBase class
Summary:
This adds a new `EdenTestCaseBase` class to serve as the base class across a
number of our integration tests and some of our CLI tests.

The main goal of this is to allow eliminating many of the annoying `*Mixin`
classes used in a lot of our integration tests.  These mixin classes are
annoying since they result in complicated multiple inheritance, and it can be
tricky to ensure that the method resolution order behaves the way you want.
The systemd tests in particular use a lot of mixins, which gets complicated.
These mixin classes are also awkward from a Python typing perspective, and the
systemd tests end up resorting to just declaring different APIs in several
places when `typing.TYPE_CHECKING` is True.

The fact that `EdenTestCaseBase` has a `contextlib.ExitStack` member variable
should make it easier for us to eliminate these mixins moving forward: rather
than using mixins that use inheritance and assume a `self.cleanUp()` method
exists, we can transition this code to standalone functions or context
managers, and they can take the `ExitStack` variable as an argument if
necessary.

Reviewed By: wez

Differential Revision: D21084097

fbshipit-source-id: 77ee457b7debe6f584f630e3e30f79fe634a2026
2020-04-22 15:02:41 -07:00
Adam Simpkins
62a463ea76 only run the git integration tests when built with git support
Summary:
Update the integration tests to only run git integration tests if EdenFS was
built with git support.

Reviewed By: genevievehelsel

Differential Revision: D21000162

fbshipit-source-id: 0a015ae93a9420f040be702096e0b378fe138e4c
2020-04-22 12:48:49 -07:00
Adam Simpkins
5917c8e097 address some pyre-fixme issues in find_executables.py
Summary:
Update the code to work around the fact that Pyre refuses to unwrap Optional
member variables.  Store the data in local variables so that Pyre will allow
unwrapping these objects after we check against None.

Reviewed By: genevievehelsel

Differential Revision: D21000165

fbshipit-source-id: 59e8430de30ec35213a53b06670b16c34be85593
2020-04-22 12:48:48 -07:00
Adam Simpkins
ba949fa2cf update some of the integration test code to use the eden.config module
Summary:
Update some of the eden integration tests to use the `eden.config` module
instead of trying to import the `__manifest__` module, which is only present
in Buck-based builds.

Reviewed By: wez

Differential Revision: D21000167

fbshipit-source-id: 347082a32e842752e5539a8e6c8addde97a16eee
2020-04-22 12:48:48 -07:00
Adam Simpkins
a26b8e9930 update edenfsctl to report the compile-time version
Summary:
Update most locations in edenfsctl to report the version number that was built
into the edenfsctl binary at build time, rather than querying the RPM database
for the installed RPM version.  The RPM behavior only works on to RedHat-based
Linux systems, and the currently running process doesn't necessarily have to
have come from the RPM.

The one place where we do still attempt to print the RPM version is in the
`edenfsctl rage` report, when running on Linux.

Reviewed By: wez

Differential Revision: D21000168

fbshipit-source-id: 0fb747e71b6950d74f22c458efa0dfcbd45270bd
2020-04-22 12:48:48 -07:00
Katie Mancini
d850667e19 expose live FUSE requests
Summary:
This exposes metrics for the live FUSE requests (the duration
of the longest outstanding request and the number of outstanding
requests).

Because FUSE is the interface through which the user mostly interacts
with the file system they provide good metrics to judge if the perfomance
of eden is normal, or there may be an issue.

Exposing these counters this way will send them to ods, so it will not only
allow for debuging current issues, but can be used to look back at previous
problems. This data could also be used for alerting or more proactive
remediation.

Metrics are exposed per checkout to allow seeing which checkout was
having issues. This data will aggregated in `eden top` to be used as
an overall health indicator, but should more information be needed it
will be logged in ods.

Reviewed By: chadaustin

Differential Revision: D20922194

fbshipit-source-id: 16208883417acb77b62bf712cfdd9068c5420303
2020-04-22 12:33:34 -07:00
Adam Simpkins
15dd55fb80 add a framework for per-platform blacklists of integration tests
Summary:
Many of our integration tests do not yet work on Windows.  In order to allow
us to start running some integration tests on Windows while not getting lots
of failure reports, this adds a framework for blacklisting specific tests on a
per-platform basis.

Reviewed By: genevievehelsel

Differential Revision: D21084150

fbshipit-source-id: 141cd11f7e8113fcbbb2416d518864fca9179554
2020-04-21 20:37:20 -07:00
Genevieve Helsel
87bd70f0b0 restructure ThriftServer stop code in takeover case
Summary:
This restructures the `ThriftServer server_` stopping logic in the graceful restart case. Instead of stopping the server, we stop listening then explicitly stop the server. This refactor should exhibit the same behavior as today since we block on `stopListening()`, but this will allow for simpler refactoring of thrift call queueing logic in the future (by removing the `stopListening()` call and replacing it with a `startQueueingAndWaitForOutstandingCallsToFinish()` type of call).

In terms of layout, this consolidates all the stopping code into one function `startTakeoverShutdown()`. This function now returns the `TakeoverData` itself instead returning a future that is fulfilled after stopping the Thrift server. The TakeoverServer still communicates via `takeoverComplete`, but now that future is stored during `startTakeoverShutdown()` instead of being the return value of `performTakeoverShutdown()`. This also generally eliminates `TakeoverPromise`.

Reviewed By: simpkins

Differential Revision: D20744151

fbshipit-source-id: 60f0c273b4f3889b53586d79efd95bfb27256e1b
2020-04-20 12:28:36 -07:00
Adam Simpkins
80a150fb53 improve a failure message in the rebase tests
Summary:
Improve some failure messages to include the full command output that we are
checking.

Reviewed By: genevievehelsel

Differential Revision: D21084135

fbshipit-source-id: 65be3adce7bf54bab6beccf5d0c463a749d585d2
2020-04-20 12:16:53 -07:00
Adam Simpkins
94c52753d1 relax checking of C++ type formatting in an integration tests
Summary:
One of the thrift tests was checking an error string that was produced from
`folly::exceptionStr()`, which includes the exception type name.  However, in
some build environments this name does not always get demangled (the folly
demangling code may not have been included in the build, or there may be some
other issue).  For instance, in some environments using the CMake-based build
I was seeing the exception type reported as `St12domain_error` instead of
`std::domain_error`.

Reviewed By: genevievehelsel

Differential Revision: D21004345

fbshipit-source-id: 8e6a4ee4d93b1aabbe9c9816c43db803e6e12798
2020-04-15 17:58:12 -07:00
Adam Simpkins
d18ce1082e split edenfsctl start into foreground vs service logic
Summary:
This refactors the `edenfsctl start` command so that we more clearly split the
functionality into two pieces:
* Starting EdenFS as a service
* Running EdenFS in the foreground

In most normal situations in production the `start`, `restart`, and `stop`
commands are used to manage running EdenFS as a service.  In the future I
believe our service management logic will start to diverge a bit more on Linux
vs Mac vs Windows, and this should help isolate the service-management code a
bit more cleanly.

The foreground behavior is mainly only used by developers during testing and
during the integration tests.  Several options like `--gdb` and `--strace` are
only allowed in foreground mode, and this refactoring makes that clearer.  In
the future we may also want to further restrict this, to allow only
specifying additional custom arguments and a custom binary path when running
in foreground mode.  However, for now I have not updated that as I believe
some of our integration tests may be exercising this behavior today.

This change also cleans up some of the platform-specific code, and lets them
share more of the logic to construct arguments for edenfs.  With this change
`edenfsctl start --foreground` now works on Windows.

Reviewed By: pkaush

Differential Revision: D20833244

fbshipit-source-id: 0f09d59702d8b64ca8f4fedccbc30da1c858afb4
2020-04-15 15:46:25 -07:00