Skip to content

Commit 4698b0b

Browse files
committed
Logging
1 parent df190d3 commit 4698b0b

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

src/AppInstallerCLICore/Commands/TestCommand.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@ namespace AppInstaller::CLI
8282
return hr;
8383
}
8484

85+
void AppShutdownTestSystemBlockNewWork(CancelReason reason)
86+
{
87+
AICLI_LOG(CLI, Info, << "AppShutdownTestSystemBlockNewWork :: " << reason);
88+
}
89+
90+
void AppShutdownTestSystemBeginShutdown(CancelReason reason)
91+
{
92+
AICLI_LOG(CLI, Info, << "AppShutdownTestSystemBeginShutdown :: " << reason);
93+
}
94+
95+
void AppShutdownTestSystemWait()
96+
{
97+
AICLI_LOG(CLI, Info, << "AppShutdownTestSystemWait");
98+
}
99+
85100
void EnsureDSCv3Processor(Execution::Context& context)
86101
{
87102
auto& configurationSet = context.Get<Execution::Data::ConfigurationContext>().Set();
@@ -354,6 +369,13 @@ namespace AppInstaller::CLI
354369
{
355370
HRESULT hr = E_FAIL;
356371

372+
ShutdownMonitoring::ServerShutdownSynchronization::ComponentSystem appShutdownTestSystem{};
373+
appShutdownTestSystem.BlockNewWork = AppShutdownTestSystemBlockNewWork;
374+
appShutdownTestSystem.BeginShutdown = AppShutdownTestSystemBeginShutdown;
375+
appShutdownTestSystem.Wait = AppShutdownTestSystemWait;
376+
377+
ShutdownMonitoring::ServerShutdownSynchronization::AddComponent(appShutdownTestSystem);
378+
357379
// Only package context and admin won't create the window message.
358380
if (!Runtime::IsRunningInPackagedContext() || !Runtime::IsRunningAsAdmin())
359381
{

src/AppInstallerCLICore/ShutdownMonitoring.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ namespace AppInstaller::ShutdownMonitoring
376376
components = m_components;
377377
}
378378

379+
AICLI_LOG(CLI, Verbose, << "ServerShutdownSynchronization :: BlockNewWork");
379380
for (const auto& component : components)
380381
{
381382
if (component.BlockNewWork)
@@ -384,6 +385,7 @@ namespace AppInstaller::ShutdownMonitoring
384385
}
385386
}
386387

388+
AICLI_LOG(CLI, Verbose, << "ServerShutdownSynchronization :: BeginShutdown");
387389
for (const auto& component : components)
388390
{
389391
if (component.BeginShutdown)
@@ -392,6 +394,7 @@ namespace AppInstaller::ShutdownMonitoring
392394
}
393395
}
394396

397+
AICLI_LOG(CLI, Verbose, << "ServerShutdownSynchronization :: Wait");
395398
for (const auto& component : components)
396399
{
397400
if (component.Wait)
@@ -400,6 +403,7 @@ namespace AppInstaller::ShutdownMonitoring
400403
}
401404
}
402405

406+
AICLI_LOG(CLI, Verbose, << "ServerShutdownSynchronization :: ShutdownCompleteCallback");
403407
ShutdownCompleteCallback callback = m_callback;
404408
if (callback)
405409
{

src/AppInstallerCLIE2ETests/AppShutdownTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ public void RegisterApplicationTest()
9595

9696
Task.WaitAll(new Task[] { testCmdTask, registerTask }, 360000);
9797

98-
// Assert.True(registerTask.Result);
99-
TestContext.Out.Write(testCmdTask.Result.StdOut);
100-
10198
// The ctrl-c command terminates the batch file before the exit code file gets created.
10299
// Look for the output.
103100
Assert.True(testCmdTask.Result.StdOut.Contains("Succeeded waiting for app shutdown event"));

0 commit comments

Comments
 (0)