Skip to content

Commit 3bb76f3

Browse files
authored
Merge branch 'master' into locks
2 parents c7eb5ee + 1274137 commit 3bb76f3

File tree

6 files changed

+70
-14
lines changed

6 files changed

+70
-14
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,13 @@ jobs:
6565
cargo run &
6666
cargo test --test persistent-after
6767
68+
stress-test:
69+
name: Stress tests
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v1
73+
- run: cargo build --verbose
74+
- run: |
75+
cargo run &
76+
cargo test --test stress_test
77+

Cargo.lock

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ edition = "2018"
77

88
[dependencies]
99
parsec-interface = { git = "https://github.com/parallaxsecond/parsec-interface-rs", tag = "0.1.0" }
10-
rand = "0.7.0"
10+
rand = "0.7.2"
1111
base64 = "0.10.1"
1212
uuid = "0.7.4"
1313
threadpool = "1.7.1"
1414
std-semaphore = "0.1.0"
1515

1616
[dev-dependencies]
17-
parsec-client-test = { git = "https://github.com/parallaxsecond/parsec-client-test", tag = "0.1.1" }
17+
parsec-client-test = { git = "https://github.com/parallaxsecond/parsec-client-test", tag = "0.1.2" }
18+
num_cpus = "1.10.1"
1819

1920
[build-dependencies]
2021
bindgen = "0.50.0"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ This project uses the following third party crates:
137137
* uuid (Apache-2.0)
138138
* threadpool (Apache-2.0)
139139
* std-semaphore (MIT and Apache-2.0)
140+
* num_cpus (MIT and Apache-2.0)
140141

141142
This project uses the following third party libraries:
142143
* [Mbed Crypto](https://github.com/ARMmbed/mbed-crypto) (Apache-2.0)

tests/all.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@ SERVER_PID=$!
7171
cargo test --test persistent-after || exit 1
7272

7373
kill $SERVER_PID
74+
75+
################
76+
# Stress tests #
77+
################
78+
cargo run &
79+
SERVER_PID=$!
80+
81+
cargo test --test stress_test || exit 1
82+
83+
kill $SERVER_PID

tests/stress_test.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) 2019, Arm Limited, All Rights Reserved
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
// not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
#[cfg(test)]
16+
mod tests {
17+
use parsec_client_test::{StressTestClient, StressTestConfig};
18+
use std::time::Duration;
19+
20+
#[test]
21+
fn stress_test() {
22+
let config = StressTestConfig {
23+
no_threads: num_cpus::get(),
24+
req_per_thread: 250,
25+
req_interval: Some(Duration::from_millis(10)),
26+
req_interval_deviation_millis: Some(4),
27+
check_interval: Some(Duration::from_millis(500)),
28+
};
29+
30+
StressTestClient::execute(config);
31+
}
32+
}

0 commit comments

Comments
 (0)