aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/driver_SUITE_data
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-12-12 21:58:25 +0100
committerSverker Eriksson <[email protected]>2017-12-12 21:58:25 +0100
commita72a33e51218b1584f87629a9725665c22f9eb09 (patch)
tree553295ed42a5275b0907c04f454798f385877435 /erts/emulator/test/driver_SUITE_data
parent003e5450924c4d8202e2013cac41eff58fa90584 (diff)
downloadotp-a72a33e51218b1584f87629a9725665c22f9eb09.tar.gz
otp-a72a33e51218b1584f87629a9725665c22f9eb09.tar.bz2
otp-a72a33e51218b1584f87629a9725665c22f9eb09.zip
erts: Trim driver_SUITE:smp_select for slow valgrind
Symptom: "Closing pipe in state Waiting. Event lost?" Snake oil: Do erlang:yield() instead of busy spinning in "Waiting" state.
Diffstat (limited to 'erts/emulator/test/driver_SUITE_data')
-rw-r--r--erts/emulator/test/driver_SUITE_data/chkio_drv.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/erts/emulator/test/driver_SUITE_data/chkio_drv.c b/erts/emulator/test/driver_SUITE_data/chkio_drv.c
index 8e5e81665c..e55b9e10ba 100644
--- a/erts/emulator/test/driver_SUITE_data/chkio_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/chkio_drv.c
@@ -1225,7 +1225,6 @@ chkio_drv_control(ErlDrvData drv_data,
break;
}
case CHKIO_SMP_SELECT: {
- int rounds = 1; /*rand(); */
ChkioSmpSelect* pip = (ChkioSmpSelect*) cddp->test_data;
if (pip == NULL) {
erl_drv_mutex_lock(smp_pipes_mtx);
@@ -1242,7 +1241,8 @@ chkio_drv_control(ErlDrvData drv_data,
}
erl_drv_mutex_unlock(smp_pipes_mtx);
}
- while (rounds--) {
+ res_str = NULL;
+ {
int op = rand_r(&pip->rand_state);
switch (pip->state) {
case Closed: {
@@ -1252,7 +1252,6 @@ chkio_drv_control(ErlDrvData drv_data,
fcntl(fds[0], F_SETFL, flags|O_NONBLOCK) < 0) {
driver_failure_posix(cddp->port, errno);
- rounds = 0;
break;
}
TRACEF(("%T: Created pipe [%d->%d]\n", cddp->id, fds[1], fds[0]));
@@ -1332,7 +1331,9 @@ chkio_drv_control(ErlDrvData drv_data,
pip->next_write++;
}
break;
- case Waiting:
+ case Waiting:
+ res_str = "yield";
+ res_len = -1;
break;
default:
fprintf(stderr, "Strange state %d\n", pip->state);
@@ -1348,9 +1349,11 @@ chkio_drv_control(ErlDrvData drv_data,
else {
cddp->test_data = pip;
}
- }
- res_str = "ok";
- res_len = -1;
+ }
+ if (!res_str) {
+ res_str = "ok";
+ res_len = -1;
+ }
break;
}
case CHKIO_DRV_USE: