Commit b6d2543c authored by gab's avatar gab Committed by Commit bot

Revert of Attempt #3 at registry outage: ShellExecute reg delete (patchset #1...

Revert of Attempt #3 at registry outage: ShellExecute reg delete (patchset #1 id:1 of https://codereview.chromium.org/2897483003/ )

Reason for revert:
Nuclear cleanup no longer needed (and having reg.exe run in parallel with the browser_tests that are starting can cause flakiness in itself).

Original issue's description:
> Attempt #3 at registry outage: ShellExecute reg delete
>
> Nuclear option to be reverted after the bots heal up.
>
> BUG=721245
> R=thakis@chromium.org
>
> Review-Url: https://codereview.chromium.org/2897483003 .
> Cr-Commit-Position: refs/heads/master@{#472945}
> Committed: https://chromium.googlesource.com/chromium/src/+/f26f6233d2d8be69c638ddac047db13fd6f14062

TBR=thakis@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=721245

Review-Url: https://codereview.chromium.org/2902683003
Cr-Commit-Position: refs/heads/master@{#473898}
parent d86012b8
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/process/process_metrics.h" #include "base/process/process_metrics.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/test/test_file_util.h" #include "base/test/test_file_util.h"
#include "build/build_config.h" #include "build/build_config.h"
...@@ -54,7 +53,6 @@ ...@@ -54,7 +53,6 @@
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
#include <shellapi.h>
#include "base/win/registry.h" #include "base/win/registry.h"
#include "chrome/app/chrome_crash_reporter_client_win.h" #include "chrome/app/chrome_crash_reporter_client_win.h"
#include "chrome/install_static/install_util.h" #include "chrome/install_static/install_util.h"
...@@ -109,37 +107,26 @@ ChromeTestLauncherDelegate::CreateContentMainDelegate() { ...@@ -109,37 +107,26 @@ ChromeTestLauncherDelegate::CreateContentMainDelegate() {
void ChromeTestLauncherDelegate::PreSharding() { void ChromeTestLauncherDelegate::PreSharding() {
#if defined(OS_WIN) #if defined(OS_WIN)
// Construct the distribution specific equivalent of // Pre-test cleanup for registry state keyed off the profile dir (which can
// "delete HKCU\\SOFTWARE\\Chromium\\PreferenceMACs /f". // proliferate with the use of uniquely named scoped_dirs):
base::string16 operation(L"delete HKCU\\"); // https://crbug.com/721245. This needs to be here in order not to be racy
operation.append(install_static::GetRegistryPath()); // with any tests that will access that state.
operation.append(L"\\PreferenceMACs /f"); base::win::RegKey distrubution_key;
// TODO(gab): This is a nuclear option while the cleanup below doesn't work as LONG result = distrubution_key.Open(HKEY_CURRENT_USER,
// the bots are in such bad shape per https://crbug.com/721245 that doing any install_static::GetRegistryPath().c_str(),
// registry operations from C++ results in fatal error 1450 (insufficient KEY_SET_VALUE);
// resources). Hopefully ShellExecute works...
::ShellExecute(NULL, NULL, L"reg.exe", operation.c_str(), NULL, 0); if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) {
LOG(ERROR) << "Failed to open distribution key for cleanup: " << result;
// // Pre-test cleanup for registry state keyed off the profile dir (which can return;
// // proliferate with the use of uniquely named scoped_dirs): }
// // https://crbug.com/721245. This needs to be here in order not to be racy
// // with any tests that will access that state. result = distrubution_key.DeleteKey(L"PreferenceMACs");
// base::win::RegKey distrubution_key;
// LONG result = distrubution_key.Open( if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) {
// HKEY_CURRENT_USER, install_static::GetRegistryPath().c_str(), LOG(ERROR) << "Failed to cleanup PreferenceMACs: " << result;
// KEY_SET_VALUE); return;
}
// if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) {
// LOG(ERROR) << "Failed to open distribution key for cleanup: " << result;
// return;
// }
// result = distrubution_key.DeleteKey(L"PreferenceMACs");
// if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) {
// LOG(ERROR) << "Failed to cleanup PreferenceMACs: " << result;
// return;
// }
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment