Closed
Bug 712155
Opened 14 years ago
Closed 14 years ago
Maintenance service: Wait for service to stop before starting the next xpcshell test
Categories
(Toolkit :: Application Update, defect)
Tracking
()
RESOLVED
FIXED
mozilla12
People
(Reporter: bbondy, Assigned: bbondy)
Details
Attachments
(2 files, 1 obsolete file)
|
8.88 KB,
patch
|
bbondy
:
review+
|
Details | Diff | Splinter Review |
|
2.99 KB,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
If the service is already running (i.e. it is already processing a command) then we fallback to a UAC prompt. When XPCShell tests run we don't allow a fallback so in this case an error code is written to the update.status file.
If you run 2 xpcshell tests for the maintenance service in a row, it has a small chance of failing due to the 2nd one not using the service. This is because the 2nd one can start before the first one stopped.
| Assignee | ||
Comment 1•14 years ago
|
||
As per our previous discussion, this replaces the 1 second wait with calling the AUS test app to do a wait for the amount of time necessary for the service to stop. It is capped at 10 seconds.
Attachment #582982 -
Flags: review?(robert.bugzilla)
Comment 2•14 years ago
|
||
Comment on attachment 582982 [details] [diff] [review]
Patch v1.
>diff --git a/toolkit/mozapps/update/common/updatelogging.h b/toolkit/mozapps/update/common/updatelogging.h
>--- a/toolkit/mozapps/update/common/updatelogging.h
>+++ b/toolkit/mozapps/update/common/updatelogging.h
>@@ -41,37 +41,35 @@
> #include "updatedefines.h"
> #include <stdio.h>
>
> class UpdateLog
> {
> public:
> static UpdateLog & GetPrimaryLog()
> {
>- if (!primaryLog) {
>- primaryLog = new UpdateLog();
>- }
>- return *primaryLog;
>+ static UpdateLog primvaryLog;
>+ return primvaryLog;
s/primvaryLog/primaryLog/
>diff --git a/toolkit/mozapps/update/test/TestAUSHelper.cpp b/toolkit/mozapps/update/test/TestAUSHelper.cpp
>--- a/toolkit/mozapps/update/test/TestAUSHelper.cpp
>+++ b/toolkit/mozapps/update/test/TestAUSHelper.cpp
>@@ -146,16 +146,72 @@ VerifyCertificateTrustForFile(LPCWSTR fi
> // no UI
> trustData.dwUIContext = 0;
> trustData.pFile = &fileToCheck;
>
> GUID policyGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
> // Check if the file is signed by something that is trusted.
> return WinVerifyTrust(NULL, &policyGUID, &trustData);
> }
>+
>+/**
>+ * Waits for a service to enter a stopped state.
>+ * This function does not stop the service, it just blocks until the service
>+ * is stopped.
>+ *
>+ * @param serviceName The service to wait for.
>+ * @param maxWaitMS The maximum number of MS to wait
I'm ok with this but I think it is clearer and simpler just to use seconds with a test helper like this.
No reason for me to review this again unless you would like me to.
Attachment #582982 -
Flags: review?(robert.bugzilla) → review+
| Assignee | ||
Comment 3•14 years ago
|
||
Implemented nits and also changed from ms to seconds.
Attachment #582982 -
Attachment is obsolete: true
Attachment #582991 -
Flags: review+
| Assignee | ||
Comment 4•14 years ago
|
||
Attachment #583256 -
Flags: review?(robert.bugzilla)
| Assignee | ||
Updated•14 years ago
|
Attachment #582991 -
Attachment description: Patch v2. → Base patch.
Updated•14 years ago
|
Attachment #583256 -
Flags: review?(robert.bugzilla) → review+
| Assignee | ||
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
| Assignee | ||
Comment 5•14 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•