collector icon indicating copy to clipboard operation
collector copied to clipboard

Add go test logging

Open robbycochran opened this issue 1 year ago • 0 comments

Description

Adds logging to the container runtime actions in collector integration tests to provide visibility and help with debugging issues. Also print last few lines of collector logs when there is a non-zero exit.

Format:

2024/08/22 01:31:35 INFO: docker ps -qa --filter id=a0b36d431974 --filter health=healthy
2024/08/22 01:31:35 ERROR: Waiting for container collector to become health=healthy, elapsed time: 2m0.025917497s
2024/08/22 01:31:40 INFO: docker ps -qa --filter id=a0b36d431974 --filter health=healthy
2024/08/22 01:31:45 INFO: docker ps -qa --filter id=a0b36d431974 --filter health=healthy
...
Collector container has non-zero exit code (134)
collector logs:
[WARNING 2024/08/22 01:29:36] (Logging.cpp:116) libbpf: failed to load BPF skeleton 'bpf_probe': -13


    	            	[ERROR   2024/08/22 01:29:36] (Logging.cpp:116) libpman: failed to load BPF object (errno: 13 | message: Permission denied)
    	            	terminate called after throwing an instance of 'sinsp_exception'
    	            	  what():  Initialization issues during scap_init
    	            	collector AbortHandler 0xa6d161 + 38
    	            	/lib64/libc.so.6 (null) 0x7955a39fa6f0 + 0
    	            	/lib64/libc.so.6 (null) 0x7955a3a4794c + 0
    	            	/lib64/libc.so.6 raise 0x7955a39fa646 + 22
    	            	/lib64/libc.so.6 abort 0x7955a39e47f3 + 211
    	            	/lib64/libstdc++.so.6 (null) 0x7955a3d5cb21 + 0
    	            	/lib64/libstdc++.so.6 (null) 0x7955a3d6852c + 0
    	            	/lib64/libstdc++.so.6 (null) 0x7955a3d68597 + 0
    	            	/lib64/libstdc++.so.6 (null) 0x7955a3d687f9 + 0
    	            	collector collector::KernelDriverCOREEBPF::Setup(collector::CollectorConfig const&, sinsp&) 0xb1b1c9 + 303
    	            	collector collector::system_inspector::Service::InitKernel(collector::CollectorConfig const&) 0xb17d98 + 1530
    	            	collector collector::CollectorService::InitKernel() 0xa7dc62 + 38
    	            	collector collector::SetupKernelDriver(collector::CollectorService&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, collector::CollectorConfig const&) 0xa7de08 + 159
    	            	collector main 0xa69e1d + 1269
    	            	/lib64/libc.so.6 (null) 0x7955a39e5590 + 0
    	            	/lib64/libc.so.6 __libc_start_main 0x7955a39e5640 + 128
    	            	collector _start 0xa68c65 + 37
    	            	Caught signal 6 (SIGABRT): Aborted
    	            	/bootstrap.sh: line 85:    10 Aborted                 (core dumped) eval exec "$@
    	Test:       	TestProcessNetwork</code></pre></td></tr>

Checklist

  • [x] Investigated and inspected CI test results
  • [ ] Updated documentation accordingly

Automated testing

  • [x] Added integration tests

Testing Performed

verified logs

robbycochran avatar Feb 11 '24 18:02 robbycochran