Update with target config before invoking Centipede. So that Centipede gets proper flags instead of the serialized target config. Makes it easier for people to understand/debug. PiperOrigin-RevId: 933084230
diff --git a/centipede/centipede_flags.inc b/centipede/centipede_flags.inc index 5dda892..f6d6da2 100644 --- a/centipede/centipede_flags.inc +++ b/centipede/centipede_flags.inc
@@ -456,7 +456,9 @@ std::string, fuzztest_configuration, "", "If set, deserializes the FuzzTest configuration from the value as a " "base64url string instead of querying the configuration via runner " - "callbacks. For FuzzTest framework only, do not use from end-users.") + "callbacks. Specially, if set to `(null)`, assumes no configuration " + "without querying the runner. For FuzzTest framework only, do not use from " + "end-users.") CENTIPEDE_FLAG( bool, list_crash_ids, false, "If set, lists the crash IDs of a single test of the binary to the "
diff --git a/centipede/centipede_interface.cc b/centipede/centipede_interface.cc index 0a3917c..0131ab6 100644 --- a/centipede/centipede_interface.cc +++ b/centipede/centipede_interface.cc
@@ -764,7 +764,9 @@ // TODO: b/410051414 Use Centipede flags to pass necessary information // instead of passing the entirely serialized Configuration once switched // to the unified execution model. - if (!env.fuzztest_configuration.empty()) { + if (env.fuzztest_configuration == "(null)") { + return ""; + } else if (!env.fuzztest_configuration.empty()) { std::string result; FUZZTEST_CHECK( absl::WebSafeBase64Unescape(env.fuzztest_configuration, &result));
diff --git a/fuzztest/internal/centipede_adaptor.cc b/fuzztest/internal/centipede_adaptor.cc index bfd67dc..aafc9e0 100644 --- a/fuzztest/internal/centipede_adaptor.cc +++ b/fuzztest/internal/centipede_adaptor.cc
@@ -269,8 +269,8 @@ std::string{test_name}}; single_test_configuration.time_limit = total_time_limit; single_test_configuration.time_budget_type = TimeBudgetType::kTotal; - env.fuzztest_configuration = - absl::WebSafeBase64Escape(single_test_configuration.Serialize()); + env.UpdateWithTargetConfig(single_test_configuration); + env.fuzztest_configuration = "(null)"; } absl::StrAppend(&env.binary,