nonnative 3.9.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef654d45571b49eaf151e67b60a8eaa5c7b6df2b1a2e877d774a30ec80cc3281
4
- data.tar.gz: 3526ed68b510ee72ac7b2d92764109bbd729653b5e1ba06b8b7a0f1f60b44c07
3
+ metadata.gz: 6a276b7ac5edae149fc6eb065909773b73c5c7e1684e4502244d88a0cdd6c521
4
+ data.tar.gz: 82545f52a383ba1f67af5c1d01c72653adee7339a3e1968fb987eabc9236421e
5
5
  SHA512:
6
- metadata.gz: f28ca3884eef23d8db41bcef405205e5afca8369622627f415a845340579e54b17102cbdcabd3d44933ae7630a26eb3c6b3ba05c3e50da08092b84ec873a1629
7
- data.tar.gz: 69166708a716e13658f5f25c86ccea83c201cccdeeec11296249fc318e7cabbec78816048ca266f9c890538b920d091968bff3275888a2c7bf7d9853343313f6
6
+ metadata.gz: 0eea335efd1554822d7153077244d2f8ff5d19c46af6b19e153bd0298e99e4902f090b933899d4614e46a88252d9b95e9f7ec92b3d6e9e824c96f00694d579f9
7
+ data.tar.gz: ce2d8e41f9313b289c3531fe8c605e869dd856a1eb8ae47bb1671ebc12aa1f97a3a8e795cad16681c11857b2a70ce4f2250b0310dd57286162cc9aed7efa764e
data/.circleci/config.yml CHANGED
@@ -32,13 +32,13 @@ jobs:
32
32
  - restore_cache:
33
33
  name: restore deps
34
34
  keys:
35
- - nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}-{{ checksum ".source-key" }}
35
+ - nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}
36
36
  - nonnative-ruby-cache-
37
37
  - run: make dep
38
38
  - run: make clean-dep
39
39
  - save_cache:
40
40
  name: save deps
41
- key: nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}-{{ checksum ".source-key" }}
41
+ key: nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}
42
42
  paths:
43
43
  - vendor
44
44
  - run: make lint
data/AGENTS.md CHANGED
@@ -74,6 +74,11 @@ of dependencies.
74
74
  use `nonnative` against real dependencies. Do not flag the in-repository
75
75
  service proxy success scenario's connection-only assertion as a test gap
76
76
  unless the task is explicitly about changing service proxy forwarding.
77
+ - `Nonnative::FaultInjectionProxy` owns its listener thread and stops it by
78
+ closing the owned `TCPServer`, which wakes the accept loop before joining the
79
+ thread. Do not flag the listener `join` as an unbounded reliability gap unless
80
+ the task is explicitly about proxy shutdown behavior or there is a normal-use
81
+ reproducer, failing CI evidence, or platform-specific hang evidence.
77
82
 
78
83
  ## Runtime Model
79
84
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (3.9.0)
4
+ nonnative (3.10.0)
5
5
  concurrent-ruby (>= 1, < 2)
6
6
  config (>= 5, < 6)
7
7
  cucumber (>= 7, < 12)
data/README.md CHANGED
@@ -94,7 +94,9 @@ Nonnative.stop
94
94
  `Nonnative.start` starts services first, then servers and processes. `Nonnative.stop` stops processes and servers first, then services. If startup fails, Nonnative rolls back runners that already started and raises `Nonnative::StartError`; shutdown failures raise `Nonnative::StopError`.
95
95
 
96
96
  > [!NOTE]
97
- > `Nonnative.clear` clears memoized configuration, logger, observability client, and pool. Use it before reconfiguring Nonnative in the same Ruby process.
97
+ > `Nonnative.start` / `Nonnative.stop` manage one lifecycle for the current pool.
98
+ > Call `Nonnative.clear` before reconfiguring Nonnative or starting a new lifecycle in the same Ruby process.
99
+ > `Nonnative.clear` clears memoized configuration, logger, observability client, and pool.
98
100
 
99
101
  ### 📈 Observability
100
102
 
@@ -20,6 +20,9 @@ module Nonnative
20
20
  @timeout = Nonnative::Timeout.new(service.timeout)
21
21
  end
22
22
 
23
+ # @return [GetProcessMem, nil] memory reader for the current process lifecycle
24
+ attr_reader :memory
25
+
23
26
  # Spawns the configured process if it is not already running.
24
27
  #
25
28
  # @return [Array<(Integer, Boolean)>]
@@ -29,6 +32,8 @@ module Nonnative
29
32
  def start
30
33
  unless process_exists?
31
34
  @pid = process_spawn
35
+ # Keep memory reads bound to the child spawned for this lifecycle.
36
+ @memory = GetProcessMem.new(pid)
32
37
  wait_start
33
38
  end
34
39
 
@@ -53,17 +58,8 @@ module Nonnative
53
58
  end
54
59
 
55
60
  [pid, stopped]
56
- end
57
-
58
- # Returns a memoized memory reader for the spawned process.
59
- #
60
- # This is primarily used by acceptance tests to assert memory usage.
61
- #
62
- # @return [GetProcessMem, nil] a memory reader for the pid, or `nil` if not started
63
- def memory
64
- return if pid.nil?
65
-
66
- @memory ||= GetProcessMem.new(pid)
61
+ ensure
62
+ @memory = nil
67
63
  end
68
64
 
69
65
  protected
@@ -4,5 +4,5 @@ module Nonnative
4
4
  # The current gem version.
5
5
  #
6
6
  # @return [String]
7
- VERSION = '3.9.0'
7
+ VERSION = '3.10.0'
8
8
  end
data/lib/nonnative.rb CHANGED
@@ -286,6 +286,9 @@ module Nonnative
286
286
 
287
287
  # Clears memoized configuration, logger, observability client, and pool.
288
288
  #
289
+ # Call this before reconfiguring Nonnative or starting a new lifecycle in the same Ruby process.
290
+ # `start`/`stop` are intended to manage one lifecycle for the current pool.
291
+ #
289
292
  # @return [void]
290
293
  def clear
291
294
  clear_logger
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski