mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 06:08:21 +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",
|
log_info("cleanup: before %s, after %s\n",
|
||||||
global::config::cleanup_before ? "Yes" : "No",
|
global::config::cleanup_before ? "Yes" : "No",
|
||||||
global::config::cleanup_after ? "Yes" : "No");
|
global::config::cleanup_after ? "Yes" : "No");
|
||||||
|
|
||||||
|
log_info("failfast: %s\n", global::config::failfast ? "Yes" : "No");
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace config */
|
} /* 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::dump_config = true;
|
||||||
global::config::cleanup_before = true;
|
global::config::cleanup_before = true;
|
||||||
global::config::cleanup_after = true;
|
global::config::cleanup_after = true;
|
||||||
|
global::config::failfast = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace global {
|
namespace global {
|
||||||
@ -86,6 +87,7 @@ unsigned timeout_duration_seconds;
|
|||||||
bool dump_config;
|
bool dump_config;
|
||||||
bool cleanup_before;
|
bool cleanup_before;
|
||||||
bool cleanup_after;
|
bool cleanup_after;
|
||||||
|
bool failfast;
|
||||||
} /* namespace config */
|
} /* namespace config */
|
||||||
|
|
||||||
} /* namespace global */
|
} /* namespace global */
|
||||||
@ -287,7 +289,7 @@ int main(int argc, char *const argv[]) {
|
|||||||
int rc = osal_actor_start(a, pid);
|
int rc = osal_actor_start(a, pid);
|
||||||
log_trace("<< actor_start");
|
log_trace("<< actor_start");
|
||||||
if (rc) {
|
if (rc) {
|
||||||
log_trace(">> killall_actors");
|
log_trace(">> killall_actors: (%s)", "start failed");
|
||||||
osal_killall_actors();
|
osal_killall_actors();
|
||||||
log_trace("<< killall_actors");
|
log_trace("<< killall_actors");
|
||||||
failure("Failed to start actor #%u (%s)\n", a.actor_id,
|
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));
|
actor->space_id, pid, status2str(status));
|
||||||
if (status > as_running) {
|
if (status > as_running) {
|
||||||
left -= 1;
|
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;
|
failed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (timeout_seconds_left == 0)
|
if (timeout_seconds_left == 0)
|
||||||
|
@ -46,6 +46,7 @@ extern unsigned timeout_duration_seconds;
|
|||||||
extern bool dump_config;
|
extern bool dump_config;
|
||||||
extern bool cleanup_before;
|
extern bool cleanup_before;
|
||||||
extern bool cleanup_after;
|
extern bool cleanup_after;
|
||||||
|
extern bool failfast;
|
||||||
} /* namespace config */
|
} /* namespace config */
|
||||||
|
|
||||||
} /* namespace global */
|
} /* namespace global */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user