rustUnstable.rustc: Fix tests by disabling lowering thread-count.

This commit is contained in:
Moritz Ulrich 2016-07-31 20:06:01 +02:00
parent 12fe154953
commit 899d026426
2 changed files with 48 additions and 2 deletions

View File

@ -6,10 +6,12 @@ rec {
shortVersion = "master-1.12.0";
forceBundledLLVM = false;
needsCmake = true;
srcRev = "c77f8ce7c3284441a00faed6782d08eb5a78296c";
srcSha = "11y24bm2rj7bzsf86iyx3v286ygxprch4c804qbl1w477mkhcac7";
configureFlags = [ "--release-channel=nightly" ];
srcRev = "d9a911d236cbecb47775276ba51a5f9111bdbc9c";
srcSha = "07wybqvnw99fljmcy33vb9iwirmp10cwy47n008p396s7pb852hv";
patches = [
./patches/disable-lockfile-check.patch
./patches/tcp-stress-test-run-a-smaller-number-of-threads.patch
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
inherit targets;
inherit targetPatches;

View File

@ -0,0 +1,44 @@
From b6202b5d602ca8216febe8ce9078581faa32955e Mon Sep 17 00:00:00 2001
From: Moritz Ulrich <moritz@tarn-vedra.de>
Date: Sat, 30 Jul 2016 09:01:13 +0200
Subject: [PATCH] tcp-stress-test: Run a smaller number of threads.
---
src/test/run-pass/tcp-stress.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs
index dfc8649..df8cdc9 100644
--- a/src/test/run-pass/tcp-stress.rs
+++ b/src/test/run-pass/tcp-stress.rs
@@ -21,6 +21,8 @@ use std::sync::mpsc::channel;
use std::time::Duration;
use std::thread::{self, Builder};
+const TARGET_CNT: usize = 256;
+
fn main() {
// This test has a chance to time out, try to not let it time out
thread::spawn(move|| -> () {
@@ -42,8 +44,9 @@ fn main() {
});
let (tx, rx) = channel();
+
let mut spawned_cnt = 0;
- for _ in 0..1000 {
+ for _ in 0..TARGET_CNT {
let tx = tx.clone();
let res = Builder::new().stack_size(64 * 1024).spawn(move|| {
match TcpStream::connect(addr) {
@@ -66,6 +69,6 @@ fn main() {
for _ in 0..spawned_cnt {
rx.recv().unwrap();
}
- assert_eq!(spawned_cnt, 1000);
+ assert_eq!(spawned_cnt, TARGET_CNT);
process::exit(0);
}
--
2.9.1