fix: stop logs tests leaking a global app-label-alias

The `app-label-alias` test left the global property set, so every later test in the file generated a vector source filtering on a label that dokku never applies to a container, silently collecting nothing. Clearing it in teardown restores log collection for the rest of the file. The cron routing test now asserts against console sinks rather than files, since the sink an event reached is identifiable from vector's own output without depending on a writable host mount, and its task sleeps either side of its output because a cron container that exits immediately is removed before vector can attach to it.
This commit is contained in:
Jose Diaz-Gonzalez
2026-08-09 02:22:13 -04:00
parent 52b26a3760
commit 3d02d81562
2 changed files with 55 additions and 36 deletions

View File

@@ -0,0 +1,16 @@
import sys
import time
def main(args):
# a log shipper attaches to a container after it receives the start event,
# and a cron container is removed the moment it exits. sleep on either side
# of the output so that the shipper has time to attach before the line is
# written and time to read it before the container is gone.
time.sleep(5)
print(' '.join(args[1:]), flush=True)
time.sleep(3)
if __name__ == '__main__':
main(sys.argv)