mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
test: failfast option.
Change-Id: I42d1bdb9c20c9b96cfa41304bd025b09fab20518
This commit is contained in:
parent
cd37b81cc5
commit
c4846c8141
@ -325,6 +325,8 @@ void dump(const char *title) {
|
||||
log_info("cleanup: before %s, after %s\n",
|
||||
global::config::cleanup_before ? "Yes" : "No",
|
||||
global::config::cleanup_after ? "Yes" : "No");
|
||||
|
||||
log_info("failfast: %s\n", global::config::failfast ? "Yes" : "No");
|
||||
}
|
||||
|
||||
} /* namespace config */
|
||||
|
12
test/main.cc
12
test/main.cc
@ -68,6 +68,7 @@ void actor_params::set_defaults(void) {
|
||||
global::config::dump_config = true;
|
||||
global::config::cleanup_before = true;
|
||||
global::config::cleanup_after = true;
|
||||
global::config::failfast = true;
|
||||
}
|
||||
|
||||
namespace global {
|
||||
@ -86,6 +87,7 @@ unsigned timeout_duration_seconds;
|
||||
bool dump_config;
|
||||
bool cleanup_before;
|
||||
bool cleanup_after;
|
||||
bool failfast;
|
||||
} /* namespace config */
|
||||
|
||||
} /* namespace global */
|
||||
@ -287,7 +289,7 @@ int main(int argc, char *const argv[]) {
|
||||
int rc = osal_actor_start(a, pid);
|
||||
log_trace("<< actor_start");
|
||||
if (rc) {
|
||||
log_trace(">> killall_actors");
|
||||
log_trace(">> killall_actors: (%s)", "start failed");
|
||||
osal_killall_actors();
|
||||
log_trace("<< killall_actors");
|
||||
failure("Failed to start actor #%u (%s)\n", a.actor_id,
|
||||
@ -331,8 +333,14 @@ int main(int argc, char *const argv[]) {
|
||||
actor->space_id, pid, status2str(status));
|
||||
if (status > as_running) {
|
||||
left -= 1;
|
||||
if (status != as_successful)
|
||||
if (status != as_successful) {
|
||||
if (global::config::failfast && !failed) {
|
||||
log_trace(">> killall_actors: (%s)", "failfast");
|
||||
osal_killall_actors();
|
||||
log_trace("<< killall_actors");
|
||||
}
|
||||
failed = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (timeout_seconds_left == 0)
|
||||
|
@ -46,6 +46,7 @@ extern unsigned timeout_duration_seconds;
|
||||
extern bool dump_config;
|
||||
extern bool cleanup_before;
|
||||
extern bool cleanup_after;
|
||||
extern bool failfast;
|
||||
} /* namespace config */
|
||||
|
||||
} /* namespace global */
|
||||
|
Loading…
Reference in New Issue
Block a user