Ivan Vilata-i-Balaguer
987b28e4e2
Use parameter-based timeouts for direct messages in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
ec216a8702
Fix direct message loop in network stress test
...
The logic was broken and all sends where packed in the same (min delay, max delay) period. Now a variable ensures that the random delay gets added to the previous time.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
6c188e35fa
Send direct messages in network stress test in a loop
...
Actually each peer runs a loop to setup messages to be sent in the future with a random delay.
This is an actual stress test for the first time. Maybe the timeouts should be adjusted accordingly.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
c8e3c6d11a
Random delay when sending direct message in network stress test
...
The delay is always longer than the one that triggers throttling. It makes not much sense for a single sending, but it will within a loop.
Also made some ``Connection`` throttle constants package-private so they can be accessed by tests.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
da145435a1
Keep destination peer address in a variable
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
109a71cd7f
Minor changes to comments and printed messages
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
53901ba798
Configure all peers once to receive direct messages in network stress test
...
Instead on adding a listener once per selected random destination peer.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
3e34d23b9e
Convert print instruction to use helper method
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
9505a28ccc
Print message receiving and sending times in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
b8d49e44b6
Send direct messages from all peers to random ones in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
97722a6ecd
Check direct message receiving side in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
30dd7f0f88
Change content of network stress test messages
...
Otherwise the destination node can have a hard time checking its content.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
2d9ed390f0
Partial direct send/receive test between two peers in network stress test
...
Still need to implement checks on the receiving side.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
9f728c19c3
Check minimum peers in network stress test
...
In preparation for direct send message test.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
a99c0ffc07
Keep Tor hidden service key when preserving network stress test data
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
a9973808b2
Make the number of peers in network stress test selectable with environment variable
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
bfbda2c38e
Turn detailed logging of network stress test into a constant
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
d439058392
Check that network stress test data directory variable is not empty
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
f100ef6384
Only keep peer keys when reusing network stress test directory
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
6c5c3371e6
Rename "temporary" to "test data" directory in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
b02c5bf2be
Move test data removal logic to instance method
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
e12d61d026
Keep network stress test data if environment variable `STRESS_TEST_DIR
` is specified
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
3a7359247b
Use sequentially named directories for peers in network stress test
...
This may allow to reuse the directory (to avoid regenerating keys, basically).
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
b3932d0bf4
Separate seed and peer listeners in network stress test
...
In this way we ensure that latches are not accidentally modified if the semantics on callbacks change, so we may be more sure that latch initial values are ok.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
1910b66aef
Wait for peer nodes bootstrap in network stress test
...
Once it threw a ``ConcurrentModificationException`` while shutting down but I've not been able to reproduce it, so keep an eye on it happening again.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
fe9b3ec5f6
Use localhost port ending in net id digit
...
Otherwise ``SeedNodesRepository`` ignores the address and peers fail to connect to the seed node.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
59f66f8ef9
Some comments to separate declarations
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
1f2d755c64
Check reception of preliminary data in peers in network stress test
...
Need to check that the seed node boots first to avoid spurious failures.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
a2d130219c
Rename latch and failure variables in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
f4aa8480f7
Fix removal of temporary directory in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
29c72cdc49
Create peer keys in network stress test
...
We should keep an eye on the setup phase getting too slow (and eating the computer's randomness) because of the generation of peer keys.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
67e68cca85
Add creation of peer nodes to network stress test
...
Only one peer for the moment, still not working since no encryption service and key ring are created.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
f7625796c8
Tune creation of seed node address in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
f238870bce
Extract constant with regtest network id
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
30e980748d
Make methods for seed node address and setup listener creation
...
This will ease redefining node type (Tor or localhost) and creating more nodes that can report setup result.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
2c61596871
Add property to check if network stress test thread report setup failure
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
9c58d9f740
Minor changes to network stress test
...
I was going to override the ``runBare()`` method to cleanup on ``setUp()`` failures, but ``tearDown()`` is called all the same.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
260840a9b2
Do not wait on seed node if not created in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
718c935fef
Some comments and better names in network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
dc149f30e3
Wait for 30 seconds in test
...
To allow test connections. Also remove stale print.
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
9f0dfb5512
Use variable to indicate whether a localhost address is being used
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
c9f0155473
Remove unnecessary imports from network stress test
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
0977ef398b
Move seed note running out of user thread, still locking
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
a9d0272e88
Start seed node in stress test, not working yet (locking)
2016-05-17 09:13:28 +02:00
Ivan Vilata-i-Balaguer
fdc0eafc67
Add skeleton for network stress unit test
2016-05-17 09:13:28 +02:00
Manfred Karrer
c745bb37a7
Merge pull request #434 from ivilata/PeerManagerInstanceMaxConn
...
Per-instance max connections in PeerManager
2016-05-14 12:10:59 +02:00
Manfred Karrer
1dae1dd096
Use long instead of int for bytes in statistics
2016-05-12 23:46:05 +02:00
Ivan Vilata-i-Balaguer
bd0f78b10a
Demote keepalive warning to debug entry
...
The error is pretty obscure for a normal user to see in console, and it just reflects a network condition or some delay in the communication with another node, which may be relatively frequent.
Leaving a TODO comment to check if this can cause issues.
2016-05-10 08:28:54 +02:00
Manfred Karrer
5b7bff1a89
Add null check
2016-05-08 22:01:57 +02:00
Manfred Karrer
538751b9da
Add log
2016-05-07 13:17:41 +02:00