test: pin ZIP timestamp in roster archive helper (#43122)

This commit is contained in:
Aniket Kumar authored and GitHub committed 2026-09-29 07:28:43 +00:00
1 parent 3813c4d552
commit 2a1211baa5
1 file changed
+5 -1
@@ -33,7 +33,11 @@ from tests.unit_tests.controllers.conftest import ControllerTestServices
def _roster_archive() -> io.BytesIO:
source = io.BytesIO()
with zipfile.ZipFile(source, "w") as archive:
archive.writestr("manifest.yaml", "format: dify.roster-agent")
# Fixed timestamp: passing a filename string stamps the current local
# time (2-second ZIP resolution), so two archives built across a
# timestamp boundary differ byte-for-byte and flake the assertion below.
info = zipfile.ZipInfo("manifest.yaml", date_time=(1980, 1, 1, 0, 0, 0))
archive.writestr(info, "format: dify.roster-agent")
source.seek(0)
return source