Fix zpool_scrub_* test cases

The zpool_scrub_002, zpool_scrub_003, zpool_scrub_004 test cases fail
reliably when running against small pools or fast storage.  This
occurs because the scrub/resilver operation completes before subsequent
commands can be run.

A one second delay has been added to 10% of zio's in order to ensure
the scrub/resilver operation will run for at least several seconds.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4450
This commit is contained in:
Brian Behlendorf
2016-03-26 14:17:26 -07:00
parent 967798d04a
commit c35b188246
6 changed files with 29 additions and 5 deletions
+4
View File
@@ -379,6 +379,10 @@ zio_handle_io_delay(zio_t *zio)
if (handler->zi_record.zi_cmd != ZINJECT_DELAY_IO)
continue;
if (handler->zi_record.zi_freq != 0 &&
spa_get_random(100) >= handler->zi_record.zi_freq);
continue;
if (vd->vdev_guid == handler->zi_record.zi_guid) {
seconds = handler->zi_record.zi_timer;
break;