Commit Graph

6 Commits

Author SHA1 Message Date
Cory Benfield fd35cd9e52
Extend the integration test harness to track FDs (#2411)
* Extend the integration test harness to track FDs

Motivation

This patch extends the NIO integration test harness to track
file descriptors, in particular to search for leaks. This
change has been validated on Linux and Darwin, and in both cases
correctly diagnoses FD leaks.

The goal is to enable us to regression test for things like

Modifications

- Add support for hooking socket and close calls.
- Wire up this support into the test harness.
- Extend the test harness to handle the logging.
- Add new regression test for #2047.

Results

We can write regression tests for FD leaks.

* Disable FD checking in most builds.

I'm doing this for speed reasons

* Always print the leaked fds number
2023-04-26 08:38:18 -07:00
Franz Busch 1abe64c5e6
Add benchmarks for `NIOAsyncWriter` and `NIOAsyncSequenceProducer` (#2301)
# Motivation
We landed the async bridge types a while back but never added allocation and performance tests. Since we expect these types to be used performance critical paths we really should cover those with tests.

# Modification
Extends the allocation counter scaffolding to support async tests. Furthermore, add allocations tests for both the writer and producer. Lastly, I a also added a performance test for the producer.

# Result
We now have baseline tests for the `NIOAsyncWriter` and `NIOAsyncSequenceProducer`

Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-10-26 03:51:20 -07:00
Johannes Weiss bf48c2beee
make the allocation counter tests more stable (#1476)
Motivation:

The core problem is that we hook the system's allocator (malloc, free,
and friends) to get the most accurate allocation counts. This however
also means that all threads count into our limits which inherently means
we can't be 100% stable always.

Previously, we just waited a fixed 100ms and expected everything to be
as quiesced as it'll get. But we can do better.

Modifications:

- discard runs with negative remaining allocations (clearly bogus,
  quiescing not long enough in a previous run)
- instead of waiting a fixed amount of time, wait until the results
  appear quiesced (stable (for first run) or zero (for subsequent runs)
  remaining allocation counts.

Result:

Allocation counter tests should be much more stable on busier machines.
2020-04-08 14:00:26 +01:00
Konrad `ktoso` Malawski 8c0e373bf5 Also collect total bytes allocated in alloc tests (#1116)
Motivation:

It is useful/interesting to have an overview about total bytes
allocated, not only the number of malloc calls.

This is not used to fail tests though, more as an informational thing.

Modifications:

Introduce and hit new counter with allocated size whenever allocations
happen.

Result:

It is possible to inspect the total allocated bytes.
2019-11-27 15:43:19 +00:00
Johannes Weiss bf2598d193 iOS & simulator compatibility (#1037)
Motivation:

We should have better iOS compatibility.

Modifications:

- make all OS-conditional imports the same
- don't check TSI_S_ESTABLISHED (which is unavailable on iOS)
- update availability to reflect the OS versions we actually support
- make sure temporary UDS paths aren't too long

Result:

better iOS compatibility
2019-06-18 10:38:39 +01:00
Johannes Weiss 5d1d59868d new alloc counter tests (#996) 2019-05-09 14:27:29 +01:00