Files
dokku/tests/apps/python/cron_task.py
Jose Diaz-Gonzalez 3d02d81562 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.
2026-08-09 02:22:13 -04:00

17 lines
468 B
Python

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)