Commit Graph

252 Commits

Author SHA1 Message Date
Andrew Noyes 2e9f5f138d Sort test files before picking one based on JOSHUA_SEED
Previously it was dependent on whatever order files were listed in a
directory, which is suboptimal.
2022-08-08 10:05:39 -07:00
A.J. Beamon b42cb48dd4 Report the unit tests being run in test harness 2022-08-07 07:37:29 -07:00
Dan Lambright f9866f419a Propagate environment variables to spaned fdbserver process 2022-08-06 11:09:09 -07:00
Andrew Noyes da1ffebcb0
Improve test harness logging when there are no trace files (#7785)
* Log OldBinary even if there are no trace files

DeterminismCheck and OldBinary attributes don't actually depend on
information in the ProgramStart event, so we can add them
unconditionally.

* Add JoshuaSeed attribute to Test element in test harness

* Add NoTraceFilesFound event in test harness

There's already something similar: NoTraceFileGenerated. It appears that
the original author only wants to log that if the process exited 0
though. I'm not sure what the reason for that is so I think it's safer
to add a new event. This will make it more clear if say an old binary is
corrupt.
2022-08-03 17:14:33 -07:00
Bala Namasivayam 996484191b Fix protocol version 2022-08-03 11:16:15 -07:00
Bala Namasivayam bf3009d6c9 Add missing CommitInfo fields to the transaction profiling analyzer 2022-08-02 17:13:03 -07:00
Vaidas Gasiunas d99d0370b1
C shim library: API for setting client library path; additional tests (#7702)
* Adding sources of the Implib.so project

* Run C unit tests and API tests with the shim library

* Reuse compilation of C test binaries with and without shim library

* Resolve client library path from an environment variable

* Refactoring: Reusable module for downloading FDB binaries

* Testing client shim library with current version and last release version

* Tests for specifying client library over an environment variable

* Enable C shim library tests on ARM

* Restore the original path for including fdb_api.hpp

* Improve cmake dependencies on doctest

* Remove unnecessary Implib.so files

* Shim library: API to specify path to the library, additional tests

* Adding shim library to Linux distribution packages

* Update link dependencies of fdb_c_shim_lib_tester

* Add dependencies on Implib.so sources

* Abort on fatal errors of shim library

* fix typo
2022-07-29 11:45:45 +02:00
Markus Pilman 92b1d1f647 Don't fail TestHarness if comment doesn't exist 2022-07-28 11:03:09 -06:00
Markus Pilman ef46f72d0c Merge remote-tracking branch 'origin/main' into features/code-coverage-test-harness 2022-07-27 10:41:18 -06:00
A.J. Beamon dec6dbfbfb
Merge pull request #7549 from sfc-gh-ajbeamon/feature-tenant-groups
Add support for tenant groups
2022-07-27 07:56:27 -07:00
Andrew Noyes de331ba080
Fix incorrect deserialization of FdbClientLogEvents::Event (#7707)
We're trying to interpret an Optional<TenantName> here, but the
python truthiness of self.get_bytes(1) is _always_ true, since it's
non-empty. We need to look at the _contents_ of that byte instead.
2022-07-26 13:10:31 -07:00
A.J. Beamon e81ed7ce51 Include encode.h in decode.h to get access to the BUFFERSIZE macro 2022-07-26 09:29:22 -07:00
Renxuan Wang dc9599f2e9
Get network interfaces ready for https proxy. (#7556)
* Move HTTP from fdbclient/ to fdbrpc/.

* Move md5 and libb64 to contrib/.

* Get network interfaces ready for https proxy.

* Rebase
2022-07-25 17:08:32 -07:00
Kevin Hoxha 058276493f
ddsketch_utility: Add utility scripts for ddsketch (#7602)
* Adds ddsketch_calc.py which implements a class for DDSketch related calculations
* Adds ddsketch_conversion.py for quickly computing a bucket index to a value or vice-versa
* Adds ddsketch_compare.py to compute how similar two ddsketch distributions are
* Adds export_graph.py to graph the ddsketch distribution outputted from mako

The arguments for ddsketch_conversion.py are:
-b, --bucket: the bucket index that we need to calculate the value from (optional)
-v, --value: the value that we need to calculate the bucket index from (optional)
-e, --error_guarantee: the error guarantee for ddsketch (optional, default is 0.005)

The arguments for ddsketch_compare.py are:
--file1: Path to first ddsketch json
--file2: Path to second ddsketch json
--txn1: The transaction type for the first file
--txn2: The transaction type for the second file
--op: The operation name (ex: GRV, GET ...)

The arguments for export_graph.py:
--file: path to ddsketch distribution
--txn, -t: Transaction type from file
--title: title for graph (optional, otherwise "Title" is used)
--savefig: Path to save the image plot (optional)
--op: Which operation to plot
2022-07-25 10:29:33 -07:00
Xiaoge Su 8ea3ef5639 fixup! Let clang accepts crc32_wrapper.c 2022-07-23 16:38:10 -07:00
Markus Pilman 3327ab395b Change test harness to include comments 2022-07-19 15:41:53 -06:00
Markus Pilman 1de37afd52
Make TEST macros C++ only (#7558)
* proof of concept

* use code-probe instead of test

* code probe working on gcc

* code probe implemented

* renamed TestProbe to CodeProbe

* fixed refactoring typo

* support filtered output

* print probes at end of simulation

* fix missed probes print

* fix deduplication

* Fix refactoring issues

* revert bad refactor

* make sure file paths are relative

* fix more wrong refactor changes
2022-07-19 13:15:51 -07:00
Marian Dvorsky ce4dc0fb0f
Update ctest_to_joshua to work with new ctests (#7584)
* Package inferred directories to the resulting tarball in ctest_to_joshua (except for the root source and build directories). This allows the API tests (which specify the workloads as a directory containing the workload specification files) to now work.
* Add bin/mkcert which is used by some tests.
* Rewrite fdb_c_shim_tests.py to specify its dependencies on command line.
2022-07-14 18:34:48 +02:00
Markus Pilman fa9e623fc1
Merge pull request #7459 from sfc-gh-ljoswiak/features/module-link-tests
Add test executables to catch missing symbols in modules
2022-07-11 17:31:11 -06:00
Vaidas Gasiunas 0a2e5c830c
C shim library build clean up (#7560)
* Remove unnecessary Implib.so files

* Improve cmake dependencies on doctest
2022-07-11 17:57:28 +02:00
Vaidas Gasiunas 1e8feb9cb8
Generate a shim library for the FDB C API (#7506)
* Adding sources of the Implib.so project

* Run C unit tests and API tests with the shim library

* Reuse compilation of C test binaries with and without shim library

* Resolve client library path from an environment variable

* Refactoring: Reusable module for downloading FDB binaries

* Testing client shim library with current version and last release version

* Tests for specifying client library over an environment variable

* Enable C shim library tests on ARM

* Restore the original path for including fdb_api.hpp
2022-07-08 16:28:35 +02:00
Andrei Gorneanu 35f693b238 Disable ffast-math for Intel compiler 2022-07-07 17:36:26 +02:00
Lukas Joswiak 618f8455c4 Add test executables to catch missing symbols
Currently, we have code in different folders like `flow/` and `fdbrpc/`
that should remain isolated. For example, `flow/` files should not
include functionality from any other modules. `fdbrpc/` files should
only be able to include functionality from itself and from `flow/`.
However, when creating a shared library, the linker doesn't complain
about undefined symbols -- this only happens when creating an
executable. Thus, for example, it is possible to forward declare an
`fdbclient` function in an `fdbrpc` file and then use it, and nothing
will break (when it should, because this is illegal).

This change adds dummy executables for a few modules (`flow`, `fdbrpc`,
`fdbclient`) that will cause a linker error if there are included
symbols which the linker can't resolve.
2022-07-06 14:49:33 -07:00
Mohamed Oulmahdi 958b1faf81
Merge pull request #7498 from apple/7477
7477 - Fix Windows build
2022-06-30 09:54:37 +02:00
Markus Pilman 8123070c2a move rapidxml to its own target 2022-06-29 16:10:14 -06:00
Mohamed Oulmahdi a5cf6f38f3 Add missing Windows crc32 headers 2022-06-29 23:44:33 +02:00
Markus Pilman 20e7371036 some Linux fixes 2022-06-28 08:51:13 -06:00
Markus Pilman 4ac236eeba fdbcli compiling 2022-06-27 19:20:18 -06:00
Markus Pilman 41181cda26 fdbserver compiling (but linking still fails) 2022-06-27 18:54:58 -06:00
Markus Pilman 03d913a1de Flow compiling 2022-06-27 17:05:55 -06:00
Ata E Husain Bohra 9396b691b7
Generate GNU compatible build-id for mockkms golang binary (#7389)
* Generate GNU compatible build-id for mockkms golang binary

Description

 diff-1: Fix compilation issue

Generate GNU compatible build-id for mockkms golang binary
Leverage "cgo" to generate build-id

Testing

Debian package build, verified the GNU build-id
2022-06-15 10:43:46 -07:00
Junhyun Shim 3e79735b2f
Authz JWT support (#7279)
* Add JWT support to TokenSign

* Encapsulate OpenSSL public/private key type

Type-safe passing around of keys without having to DER/PEM-serialize
(OpenSSL doesn't have distinct types for public and private key)

* Apply Clang format

* Add verify benchmark for JWT and FlatBuffers token

* Unit test base64url::{encode, decode}

* Make all payload fields optional

Let user code validate non-signature fields

* Make all payload fields optional

Completely defer field check to user code

* Move rapidjson from fdbclient to contrib

* Make fdbrpc's rapidjson linkage private

Currently only sources include them.

* Modify rapidjson path in apiversioner.py

* Algorithm::Unknown > Algorithm::UNKNOWN
2022-06-02 13:22:50 +02:00
Markus Pilman 452315ee78
Build mockkms and add mockkms test (#7153) 2022-05-12 15:07:02 -07:00
Andrew Noyes 17140a2645 Always run valgrind on the binary under test (if valgrind is enabled) 2022-05-10 14:46:22 -07:00
Bala Namasivayam 57f5ca2522 Fix deserialization of tenant field in 7.1 2022-05-09 19:12:12 -07:00
Andrew Noyes 9f8e2a4517
Test compiling an fdb_c app in pkg_tester (#6940)
* Use execstack to test executable stack permissions

The output of readelf wasn't stable

* Tee output to stdout in pkg_tester "run" function

* Test compiling an app that includes fdb_c.h

Featuring both cmake and pkg_tester, since we intend to support those in
our packages.

* Fix packaging bug

The libdir in the pkg-config file in the packages was wrong
2022-04-26 11:54:52 -07:00
Aaron Molitor c440365779 update version to 7.2.0 -- pr comment protocol version 2022-04-11 23:23:27 -05:00
Aaron Molitor 8db8545db2 update version to 7.2.0 -- protocol version changes 2022-04-11 23:23:27 -05:00
A.J. Beamon ca653c77ee
Tenant binding tester support (#6642)
* Add binding tester support for tenants

* Configure tenant_mode=optional_experimental in the binding tester

* Use the special key-space to delete tenants in between binding tester runs.

* Separate tenant tester spec into its own file.
2022-03-23 13:57:45 -07:00
Josh Slocum f27475e2f4 Merge branch 'main' into blob_integration 2022-03-22 11:41:58 -05:00
Josh Slocum 37e7c80f26 Merge branch 'main' into blob_integration 2022-03-17 18:45:42 -05:00
Andrew Noyes 68c03a7e32
Jemalloc integration fixes (#6626)
* Set default for USE_JEMALLOC initially in ConfigureCompiler

Instead of trying to change the value later on. This fixes the valgrind
build, which was previously incorrectly getting jemalloc involved.

* Check aligned_alloc result for null

And OOM if so - don't assert

* Check that we can allocate magazines with no internal fragmentation

We may want to do this so that the jemalloc heap profiler has some
knowledge of FastAlloc

* Populate TestFile field for noSim tests in TestHarness

* Remove handling for nonexistent "ActualRun"
2022-03-17 15:17:27 -07:00
A.J. Beamon 00277140ec Non-simulated test harness runs don't check the unseed. 2022-03-17 11:09:14 -07:00
Steve Atherton 59762fc784
Merge pull request #6423 from sfc-gh-satherton/redwood-bug-fixes-and-memory-leak
Redwood memory usage and small memory leak fixes
2022-03-15 16:52:28 -07:00
A.J. Beamon ecccfd0868 Add cache invalidation to tenant cache. Send tenant ID along with tenant name in requests to validate that the tenant hasn't changed. Fix a few bugs. 2022-03-15 09:23:30 -07:00
Josh Slocum e71b3533f9 Merge branch 'main' into blob_integration 2022-03-09 08:59:56 -06:00
Andrew Noyes a827e1cbd5 Flush all output streams in flushAndExit
Also detect reading past the end of the infile for debug_determinism tracing
2022-03-07 13:25:52 -08:00
Jingyu Zhou 89648769d0 Fix clang format and cmake files for fmt 8.1.1 2022-03-04 15:52:06 -08:00
Jingyu Zhou 212e5147b9 Update fmt from 8.0.1 to 8.1.1
8.1.1 provides fmt::fprintf().
2022-03-04 15:52:06 -08:00
zhenfeng yang 847cff72b7
Add a target to generate profile (#6396)
add a target to generate profile
2022-02-28 17:00:30 -06:00
Andrew Noyes 2e8bce04c6 Remove brittle fdbcli help text snapshot test
This seems to be more trouble than value so far.
2022-02-28 15:24:29 -06:00
Andrew Noyes d559caefea Use centos:7 for pkg_tester
yum update with just `centos` seems to have problems
2022-02-28 15:24:29 -06:00
Steve Atherton 6f16702042 Merge branch 'main' of https://github.com/apple/foundationdb into redwood-bug-fixes-and-memory-leak 2022-02-26 18:00:18 -08:00
Andrew Noyes 7a9217a392
Add contrib/debug_determinism (#6389)
* Add contrib/debug_determinism

Add an instrumentation-based technique for debugging unseen mismatches. Also guard a few existing sources of nondeterminism that don't affect unseen with the DEBUG_DETERMINISM macro.

Also change the simulated run loop to not run as the only task inside the real run loop, since that was a source of nondeterminism.

Also fix nondeterminism from calling timer_int

* Add StorageMetadataType::currentTime

Basically a deterministic-in-simulation version of timer_int that we can
use instead of timer_int for StorageMetadataType::createdTime
2022-02-25 12:54:31 -08:00
Steve Atherton f995b4a502 Merge branch 'main' of https://github.com/apple/foundationdb into redwood-bug-fixes-and-memory-leak 2022-02-18 18:44:28 -08:00
Steve Atherton 31ed478488 Invert sort order of periodic memory usage dumps to make looking at live output easier. 2022-02-17 16:03:33 -08:00
Josh Slocum 38a75a8b89 Merge branch 'main' into blob_integration 2022-02-17 17:47:38 -06:00
Josh Slocum fc0c0ac21e script for debugging MemSample traces 2022-02-17 16:09:05 -06:00
Andrew Noyes 00ceaeb1b3 Move generated part of Program.cs to its own file
This way editors/tools will understand that it's a c sharp file
2022-02-07 13:28:06 -08:00
Andrew Noyes 4bf14e6c47
Create joshua package from ctest tests (#6237)
* Add ctest_to_joshua.py

* WIP

* Normalize python3

* set -euxo pipefail

* Strip binary files

* Remove unnecessary file copy

* Redirect stderr to stdout

* Fix syntax

* Set BASH_XTRACEFD=1
2022-02-03 15:07:41 -08:00
Andrew Noyes f4b0de7a56 Add support for 7.0 and 7.1 in transaction_profiling_analyzer
I painstakingly went through both transaction_profiling_analyzer.py and
fdbclient/ClientLogEvents.h to make sure that we really can read these
versions.
2022-01-19 14:00:21 -08:00
A.J. Beamon 496000477c
Merge pull request #6144 from sfc-gh-ajbeamon/unify-flags
Convert command line arguments to use hyphens rather than underscores
2021-12-15 10:47:32 -08:00
A.J. Beamon ca47b436ac
Apply suggestions from code review
Co-authored-by: Markus Pilman <markus.pilman@snowflake.com>
2021-12-14 14:44:20 -08:00
A.J. Beamon 30e2c2d9a6 Don' use new-style arguments in test harness. 2021-12-14 12:31:12 -08:00
A.J. Beamon f24adc7b6a Fix a bunch of places where we used old-style arguments. Allow hyphens for profiler args. 2021-12-14 09:59:14 -08:00
Andrew Noyes 66b387916a Add test for correct permissions for libfdb_c execstack 2021-12-09 17:15:22 -08:00
Aaron Molitor 77db63274b use FDB_VERSION in lieu of PROJECT_VERSION or CMAKE_PROJECT_VERSION
write FDB_VERSION to a file to avoid regex golf in other build scripts
2021-11-29 15:11:20 -08:00
Steve Atherton 8a6df5c31c Remove unsupported .clang-format setting. 2021-11-17 09:59:38 -08:00
Markus Pilman b1633b90f1 Added fmt to flow 2021-11-16 12:03:49 -07:00
Josh Slocum 7492a9e7d7 fixing fdbcli packages 2021-10-22 11:58:10 -05:00
Chaoguang Lin 0d1382eeba Add comments for the change 2021-09-03 14:32:27 -07:00
Chaoguang Lin 56ed0f3b9c Return if no available binary in the given range 2021-09-03 14:21:16 -07:00
Chaoguang Lin 8622363395 Simplify the condition and update the comment 2021-09-02 18:51:39 -07:00
Chaoguang Lin 3ad620b2df Update comment to be more clear 2021-09-02 18:13:04 -07:00
Chaoguang Lin e7028b7915 Handle the edge case correctly when the upper bound version is less than the binary verion 2021-09-02 17:42:46 -07:00
Chaoguang Lin 82e1e850c2 Add syntax until_*.*.* in restarting test to specify upper bound of binary version 2021-09-02 14:07:15 -07:00
Andrew Noyes cbd0c33e13 Try using less privileges in for running systemd 2021-08-24 17:40:44 +00:00
Andrew Noyes 97568645a1 Move .venv to main .gitignore 2021-08-19 20:25:18 +00:00
Andrew Noyes 82d0ef705d Tests pass for versioned packages 2021-08-19 16:32:22 +00:00
Andrew Noyes 8bbcfca8a0 Run all tests for versioned packages 2021-08-19 16:32:22 +00:00
Andrew Noyes 505ba2fc42 Works for ubuntu 2021-08-19 16:32:22 +00:00
Andrew Noyes 357c3ca2f8 Add simple test for versioned packages 2021-08-19 16:32:22 +00:00
Andrew Noyes 1bc944e8b9 Add development header to readme 2021-08-19 16:32:22 +00:00
Andrew Noyes f42e8d2407 Typing fixes found with mypy 2021-08-19 16:32:22 +00:00
Andrew Noyes b425d495cf Mention potential leaked containers 2021-08-19 16:32:22 +00:00
Andrew Noyes 1e202da08d Reduce likelihood of leaking containers/images 2021-08-19 16:32:22 +00:00
Andrew Noyes a62f84b84a Basic tests for rpm and deb packages 2021-08-19 16:32:22 +00:00
Jingyu Zhou fffb0d6fb9
Merge pull request #5305 from sajjadrahnama/test_harness_buggify_fault_injection
Test harness Buggify/FaultInjection argument
2021-07-30 09:15:59 -07:00
Sajjad 5b191fccfe
Update contrib/TestHarness/Program.cs.cmake - Minor change
Co-authored-by: Jingyu Zhou <jingyuzhou@gmail.com>
2021-07-29 23:18:15 -07:00
Sajjad Rahnama 12e1a5fe92 TestHarness Buggify/FaultInjection Enable/Disable - Update Old Binaries arguments 2021-07-29 11:26:14 -07:00
Steve Atherton b3e22ad573 Move stderr exception checking so that ignored output does not count against the error limit. 2021-07-26 18:10:03 -07:00
Sajjad Rahnama c7ef116c12 TestHarness Buggify/FaultInjection Enable/Disable 2021-07-26 16:44:10 -07:00
Steve Atherton ff8a1e0ed2 Ignore warning from valgrind about F_SET_RW_HINT usage. 2021-07-26 16:37:55 -07:00
Steve Atherton 26d886c600
Merge pull request #5227 from sfc-gh-satherton/redwood-io-priority
Add Priority to Redwood IO, also fixes several bugs with the recent Redwood metrics changes
2021-07-20 16:50:58 -07:00
Steve Atherton 09a8561606 Merge branch 'master' of github.com:apple/foundationdb into redwood-io-priority
# Conflicts:
#	fdbserver/IPager.h
#	fdbserver/VersionedBTree.actor.cpp
2021-07-18 01:49:36 -07:00
Oleg Samarin 97bcb16000 Fixed formatting 2021-07-14 19:24:04 +03:00
Oleg Samarin e97fb31d9b Added some comment 2021-07-14 17:46:15 +03:00
Oleg Samarin 04549c59ed Fixed 'NoTraceFileGenerated' error in simulation tests when fdbserver process could not start 2021-07-14 17:41:08 +03:00
Aaron Molitor c5a9ff02a9 move file out of build directory 2021-07-12 13:06:29 -07:00
Daniel Smith efdda3cd0e Revert "Revert "Add support for running non-simulation tests on Joshua"" 2021-06-15 14:15:02 -04:00