Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output the Tentacle Log file to the test output when a test fails #735

Merged
merged 6 commits into from
Dec 12, 2023

Conversation

nathanwoctopusdeploy
Copy link
Contributor

@nathanwoctopusdeploy nathanwoctopusdeploy commented Dec 11, 2023

Background

Write the Tentacle Log file to the test output when the test fails to try and help diagnose the reason for the failure.

Results

look for

00:00:05.0624261 [WorkspaceCleanerTests] ############################################
00:00:05.0624299 [WorkspaceCleanerTests] #########    START TENTACLE LOG    #########
00:00:05.0624339 [WorkspaceCleanerTests] ############################################
00:00:00.0000850 [WorkspaceCleanerTests] Test started
00:00:00.0977622 [ClientAndTentacleBuilder] Tentacle.exe location: F:\Code\OctopusTentacle\source\Octopus.Tentacle\bin\net6.0\Tentacle.exe
00:00:00.0989101 [ListeningTentacleBuilder] Tentacle.exe location: F:\Code\OctopusTentacle\source\Octopus.Tentacle\bin\net6.0\Tentacle.exe
00:00:00.6236432 [ListeningTentacleBuilder] [Tentacle] Creating empty configuration file: C:\Users\natha\AppData\Local\testhost\Temp\76763698-be27-4e39-984d-8f6a6eefa7b3\TentacleIT-e9d2a7c1a58b4515840af7655fa48590.cfg
00:00:00.6246841 [ListeningTentacleBuilder] [Tentacle] Setting home directory to: C:\Users\natha\AppData\Local\testhost\Temp\76763698-be27-4e39-984d-8f6a6eefa7b3
00:00:00.6651764 [ListeningTentacleBuilder] [Tentacle] Saving instance: TentacleIT-e9d2a7c1a58b4515840af7655fa48590
00:00:01.2244504 [ListeningTentacleBuilder] [Tentacle] Importing the certificate stored in PFX file in F:\Code\OctopusTentacle\source\Octopus.Tentacle.Tests.Integration\bin\net6.0\Certificates\Tentacle.pfx...
00:00:01.2853959 [ListeningTentacleBuilder] [Tentacle] Certificate with thumbprint 36F35047CE8B000CF4C671819A2DD1AFCDE3403D imported successfully.
00:00:01.2861453 [ListeningTentacleBuilder] [Tentacle] These changes require a restart of the Tentacle.
00:00:02.1780585 [ITentacleBuilder] [Tentacle] Agent will trust Octopus Servers with the thumbprint: 76225C0717A16C1D0BA4A7FFA76519D286D8A248
00:00:02.2010483 [ITentacleBuilder] [Tentacle] listen://[::]:60655/              1  Listener started
00:00:02.2024857 [ITentacleBuilder] [Tentacle] Agent listening on: [::]:0
00:00:02.2287996 [TentacleClient] Verbose "Determining ScriptService version to use"
11/12/2023 4:21:49 PM 6 Verbose Determining ScriptService version to use
00:00:02.3297619 [ITentacleBuilder] [Tentacle] listen://[::]:60655/              6  Accepted TCP client: [::1]:60656
00:00:02.5118078 [ITentacleBuilder] [Tentacle] listen://[::]:60655/              4  Client at [::1]:60656 authenticated as 76225C0717A16C1D0BA4A7FFA76519D286D8A248
00:00:02.6265261 [TentacleClient] Verbose "Discovered Tentacle capabilities: IScriptService,IFileTransferService,IScriptServiceV2,IScriptServiceV3Alpha"
11/12/2023 4:21:49 PM 6 Verbose Discovered Tentacle capabilities: IScriptService,IFileTransferService,IScriptServiceV2,IScriptServiceV3Alpha
00:00:02.6267178 [TentacleClient] Verbose "ScriptServiceV3Alpha is disabled and will not be used."
11/12/2023 4:21:49 PM 6 Verbose ScriptServiceV3Alpha is disabled and will not be used.
00:00:02.6268193 [TentacleClient] Verbose "Using ScriptServiceV2"
11/12/2023 4:21:49 PM 6 Verbose Using ScriptServiceV2
00:00:02.6269680 [TentacleClient] Verbose "RPC call retries are enabled. Retry timeout 120 seconds"
11/12/2023 4:21:49 PM 6 Verbose RPC call retries are enabled. Retry timeout 120 seconds
00:00:03.2481316 [ITentacleBuilder] [Tentacle] Deleted 1 workspace.
00:00:04.4996113 [ClientAndTentacle] ****** ****** ****** ****** ****** ****** ******
00:00:04.4996175 [ClientAndTentacle] ****** CLIENT AND TENTACLE DISPOSE CALLED  *****
00:00:04.4996202 [ClientAndTentacle] *     Subsequent errors should be ignored      *
00:00:04.4996246 [ClientAndTentacle] ****** ****** ****** ****** ****** ****** ******
00:00:04.4996266 [ClientAndTentacle] Starting DisposeAsync
00:00:04.4996293 [ClientAndTentacle] Starting RunningTentacle.DisposeAsync and Server.Dispose and PortForwarder.Dispose
00:00:04.5001509 [RunningTentacle] Starting DisposeAsync
00:00:04.5001570 [RunningTentacle] Starting Stop
00:00:04.5224600 [Server] Starting ServerHalibutRuntime.DisposeAsync
00:00:04.5235662 [RunningTentacle] Starting deleteInstanceFunction
00:00:04.5534545 [Server] Finished ServerHalibutRuntime.DisposeAsync
00:00:05.0277070 [ListeningTentacleBuilder] [Tentacle] Deleted instance: TentacleIT-e9d2a7c1a58b4515840af7655fa48590
00:00:05.0539575 [RunningTentacle] Starting temporaryDirectory.Dispose
00:00:05.0558010 [RunningTentacle] Finished DisposeAsync
00:00:05.0558550 [ClientAndTentacle] Starting TentacleClient.Dispose
00:00:05.0559343 [ClientAndTentacle] Starting TemporaryDirectory.Dispose
00:00:05.0563582 [ClientAndTentacle] Finished DisposeAsync
00:00:05.0624261 [WorkspaceCleanerTests] ############################################
00:00:05.0624299 [WorkspaceCleanerTests] #########    START TENTACLE LOG    #########
00:00:05.0624339 [WorkspaceCleanerTests] ############################################
00:00:05.0624816 [WorkspaceCleanerTests] 
2023-12-11 16:21:48.5422  60160      1  INFO  ================================================================================
2023-12-11 16:21:48.5422  60160      1  INFO  Changed log folder from C:\Users\natha\AppData\Local\Octopus\Logs to C:\Users\natha\AppData\Local\testhost\Temp\76763698-be27-4e39-984d-8f6a6eefa7b3\Logs
2023-12-11 16:21:48.5422  60160      1  INFO  Tentacle version 0.0.0-local (0.0.0-local) instance TentacleIT-e9d2a7c1a58b4515840af7655fa48590
2023-12-11 16:21:48.5422  60160      1  INFO  Environment Information:
  OperatingSystem: Microsoft Windows 10.0.22635
  OsBitVersion: x64
  Is64BitProcess: True
  CurrentUser: DESKTOP-LS2NDLB\natha
  MachineName: DESKTOP-LS2NDLB
  ProcessorCount: 16
  CurrentDirectory: C:\Users\natha\AppData\Local\testhost\Temp\76763698-be27-4e39-984d-8f6a6eefa7b3
  TempDirectory: C:\Users\natha\AppData\Local\Temp\
  HostProcessName: Tentacle
  PID: 60160
2023-12-11 16:21:48.5636  60160      1 TRACE  Selecting the most appropriate host
2023-12-11 16:21:48.5636  60160      1 TRACE  The ImportCertificateCommand must run interactively; using a console host
2023-12-11 16:21:48.5636  60160      1  INFO  ==== ImportCertificateCommand ====
2023-12-11 16:21:48.5636  60160      1  INFO  CommandLine: F:\Code\OctopusTentacle\source\Octopus.Tentacle\bin\net6.0\Tentacle.dll import-certificate --from-file=F:\Code\OctopusTentacle\source\Octopus.Tentacle.Tests.Integration\bin\net6.0\Certificates\Tentacle.pfx --instance=TentacleIT-e9d2a7c1a58b4515840af7655fa48590
2023-12-11 16:21:48.5636  60160      1  INFO  Importing the certificate stored in PFX file in F:\Code\OctopusTentacle\source\Octopus.Tentacle.Tests.Integration\bin\net6.0\Certificates\Tentacle.pfx...
2023-12-11 16:21:48.6339  60160      1  INFO  Certificate with thumbprint 36F35047CE8B000CF4C671819A2DD1AFCDE3403D imported successfully.
2023-12-11 16:21:48.6348  60160      1  WARN  These changes require a restart of the Tentacle.
2023-12-11 16:21:48.6348  60160      1 TRACE  Sending stop signal to current command
2023-12-11 16:21:48.6348  60160      1 TRACE  Disposing of the container
2023-12-11 16:21:49.3076  22024      1  INFO  ================================================================================
2023-12-11 16:21:49.3076  22024      1  INFO  Changed log folder from C:\Users\natha\AppData\Local\Octopus\Logs to C:\Users\natha\AppData\Local\testhost\Temp\76763698-be27-4e39-984d-8f6a6eefa7b3\Logs
2023-12-11 16:21:49.3076  22024      1  INFO  Tentacle version 0.0.0-local (0.0.0-local) instance TentacleIT-e9d2a7c1a58b4515840af7655fa48590
2023-12-11 16:21:49.3076  22024      1  INFO  Environment Information:
  OperatingSystem: Microsoft Windows 10.0.22635
  OsBitVersion: x64
  Is64BitProcess: True
  CurrentUser: DESKTOP-LS2NDLB\natha
  MachineName: DESKTOP-LS2NDLB
  ProcessorCount: 16
  CurrentDirectory: C:\Users\natha\AppData\Local\testhost\Temp\76763698-be27-4e39-984d-8f6a6eefa7b3
  TempDirectory: C:\Users\natha\AppData\Local\Temp\
  HostProcessName: Tentacle
  PID: 22024
2023-12-11 16:21:49.3260  22024      1 TRACE  Selecting the most appropriate host
2023-12-11 16:21:49.3260  22024      1 TRACE  The --noninteractive switch was provided for a supported command
2023-12-11 16:21:49.3260  22024      1  INFO  ==== RunAgentCommand ====
2023-12-11 16:21:49.3260  22024      1  INFO  CommandLine: F:\Code\OctopusTentacle\source\Octopus.Tentacle\bin\net6.0\Tentacle.dll agent --instance=TentacleIT-e9d2a7c1a58b4515840af7655fa48590 --noninteractive
2023-12-11 16:21:49.3584  22024      1 DEBUG  Loading certificate with thumbprint: 36F35047CE8B000CF4C671819A2DD1AFCDE3403D
2023-12-11 16:21:49.3758  22024      1 DEBUG  Certificate was found in store
2023-12-11 16:21:49.3929  22024      1 DEBUG  Loading certificate with thumbprint: 36F35047CE8B000CF4C671819A2DD1AFCDE3403D
2023-12-11 16:21:49.3929  22024      1 DEBUG  Certificate was found in store
2023-12-11 16:21:49.4144  22024      1 DEBUG  Loading certificate with thumbprint: 36F35047CE8B000CF4C671819A2DD1AFCDE3403D
2023-12-11 16:21:49.4167  22024      1 DEBUG  Certificate was found in store
2023-12-11 16:21:49.4623  22024      1 DEBUG  Loading certificate with thumbprint: 36F35047CE8B000CF4C671819A2DD1AFCDE3403D
2023-12-11 16:21:49.4623  22024      1 DEBUG  Certificate was found in store
2023-12-11 16:21:49.5238  22024      1  INFO  Agent will trust Octopus Servers with the thumbprint: 76225C0717A16C1D0BA4A7FFA76519D286D8A248
2023-12-11 16:21:49.5496  22024      1  INFO  listen://[::]:60655/              1  Listener started
2023-12-11 16:21:49.5496  22024      1  INFO  Agent listening on: [::]:0
2023-12-11 16:21:49.5614  22024      6 DEBUG  Cleaning workspaces older than 12/11/2023 06:21
2023-12-11 16:21:49.5614  22024      6 DEBUG  No workspaces found that need to be deleted.
2023-12-11 16:21:49.6784  22024      6  INFO  listen://[::]:60655/              6  Accepted TCP client: [::1]:60656
2023-12-11 16:21:49.6842  22024      6 TRACE  listen://[::]:60655/              6  Performing TLS server handshake
2023-12-11 16:21:49.8203  22024      4 TRACE  listen://[::]:60655/              4  Secure connection established, client is not yet authenticated, client connected with Tls12
2023-12-11 16:21:49.8593  22024      4 TRACE  listen://[::]:60655/              4  Begin authorization
2023-12-11 16:21:49.8593  22024      4  INFO  listen://[::]:60655/              4  Client at [::1]:60656 authenticated as 76225C0717A16C1D0BA4A7FFA76519D286D8A248
2023-12-11 16:21:49.8593  22024      4 TRACE  listen://[::]:60655/              4  Begin message exchange
2023-12-11 16:21:49.9215  22024      4 TRACE  listen://[::]:60655/              4  Received: ICapabilitiesServiceV2::GetCapabilitiesAsync[1] / 0ac4e6cb-e12e-4510-96bc-d5baa23c6423
2023-12-11 16:21:49.9515  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage
2023-12-11 16:21:49.9979  22024      4 TRACE  listen://[::]:60655/              4  Received: IScriptServiceV2::StartScriptAsync[1] / 68f0b578-ee1d-4c02-b42e-4a10604e003b
2023-12-11 16:21:50.0184  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage
2023-12-11 16:21:50.0184  22024     11 TRACE  [4be6e1f1-87ca-4feb-b6cb-ddaa50684bea] [RunningScript] [Read Lock] [no locks] Trying to acquire lock.
2023-12-11 16:21:50.0184  22024     11 TRACE  [4be6e1f1-87ca-4feb-b6cb-ddaa50684bea] [RunningScript] [Read Lock] [no locks] Trying to acquire lock with wait time of 24.20:31:23.6470000.
2023-12-11 16:21:50.0184  22024     11 TRACE  [4be6e1f1-87ca-4feb-b6cb-ddaa50684bea] [RunningScript] [Read Lock] ["4be6e1f1-87ca-4feb-b6cb-ddaa50684bea" (has a read lock)] Lock acquired.
2023-12-11 16:21:50.0275  22024      4 TRACE  listen://[::]:60655/              4  Received: IScriptServiceV2::GetStatusAsync[2] / 7f24bdb6-bc7a-4355-944a-2641876a4c51
2023-12-11 16:21:50.0275  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage
2023-12-11 16:21:50.0758  22024      6 DEBUG  Cleaning workspaces older than 12/11/2023 06:21
2023-12-11 16:21:50.0758  22024      6 DEBUG  No workspaces found that need to be deleted.
2023-12-11 16:21:50.3910  22024      4 TRACE  listen://[::]:60655/              4  Received: IScriptServiceV2::GetStatusAsync[3] / c13c4bbb-438c-48a7-a2a1-53e591650803
2023-12-11 16:21:50.3910  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage
2023-12-11 16:21:50.5903  22024      8 DEBUG  Cleaning workspaces older than 12/11/2023 06:21
2023-12-11 16:21:50.5903  22024      6  INFO  Deleted 1 workspace.
2023-12-11 16:21:50.7940  22024      4 TRACE  listen://[::]:60655/              4  Received: IScriptServiceV2::GetStatusAsync[4] / 8928e02d-1d09-49a7-8143-071ba0ed357f
2023-12-11 16:21:50.7940  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage
2023-12-11 16:21:51.1033  22024      6 DEBUG  Cleaning workspaces older than 12/11/2023 06:21
2023-12-11 16:21:51.1033  22024      6 DEBUG  No workspaces found that need to be deleted.
2023-12-11 16:21:51.2618  22024      4 TRACE  listen://[::]:60655/              4  Received: IScriptServiceV2::GetStatusAsync[5] / 6f3c43e7-57d8-4431-91f8-2393e6e4e3ba
2023-12-11 16:21:51.2618  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage
2023-12-11 16:21:51.5442  22024     11 TRACE  [4be6e1f1-87ca-4feb-b6cb-ddaa50684bea] [RunningScript] [Read Lock] ["4be6e1f1-87ca-4feb-b6cb-ddaa50684bea" (has a read lock)] Releasing lock.
2023-12-11 16:21:51.6198  22024     13 DEBUG  Cleaning workspaces older than 12/11/2023 06:21
2023-12-11 16:21:51.6198  22024     13 DEBUG  No workspaces found that need to be deleted.
2023-12-11 16:21:51.7921  22024      4 TRACE  listen://[::]:60655/              4  Received: IScriptServiceV2::GetStatusAsync[6] / 3e2a2238-34c0-4941-a1dd-3a029d4d1e14
2023-12-11 16:21:51.7921  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage
2023-12-11 16:21:51.7921  22024      4 TRACE  listen://[::]:60655/              4  Received: IScriptServiceV2::CompleteScriptAsync[7] / 2e95c6d4-70f7-454c-a563-ff8b3e414439
2023-12-11 16:21:51.7921  22024      4 TRACE  listen://[::]:60655/              4  Sent: Halibut.Transport.Protocol.ResponseMessage

00:00:05.0624992 [WorkspaceCleanerTests] ############################################
00:00:05.0625054 [WorkspaceCleanerTests] #########     END TENTACLE LOG     #########
00:00:05.0625068 [WorkspaceCleanerTests] ############################################
00:00:05.0628833 [WorkspaceCleanerTests] Staring Test Tearing Down
00:00:05.0628869 [WorkspaceCleanerTests] Cancelling CancellationTokenSource
00:00:05.0628935 [WorkspaceCleanerTests] Disposing CancellationTokenSource
00:00:05.0628958 [WorkspaceCleanerTests] Finished Test Tearing Down

How to review this PR

Quality ✔️

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

try
{
var logFilePAth = RunningTentacle.LogFilePath;
var destinationFilePath = Path.Combine(TestContext.CurrentContext.TestDirectory, TestContext.CurrentContext.Test.ID + ".tentaclelog");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@nathanwoctopusdeploy nathanwoctopusdeploy enabled auto-merge (squash) December 11, 2023 23:55
@nathanwoctopusdeploy nathanwoctopusdeploy merged commit 032f5ba into main Dec 12, 2023
@nathanwoctopusdeploy nathanwoctopusdeploy deleted the sast/capture-tentalce-log-file-on-failure branch December 12, 2023 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants