From 0bd1d5404986897951f6a09935d4b603b4600202 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 10 Jul 2017 21:28:15 +0200 Subject: [PATCH] Fix race condition in test_challenge_build (APKINDEX timestamp) --- test/test_challenge_build.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/test_challenge_build.py b/test/test_challenge_build.py index ea835dd2..80de736d 100644 --- a/test/test_challenge_build.py +++ b/test/test_challenge_build.py @@ -52,15 +52,17 @@ def test_challenge_build(args): version = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"] temp_path = pmb.chroot.other.tempfolder(args, "/tmp/test_challenge_build/" + args.arch_native) - apk_path = ("/home/user/packages/user/" + args.arch_native + "/" + pkgname + - "-" + version + ".apk") - pmb.chroot.user(args, ["cp", apk_path, apk_path + - ".buildinfo.json", temp_path]) + packages_path = "/home/user/packages/user/" + args.arch_native + apk_path = packages_path + "/" + pkgname + "-" + version + ".apk" + pmb.chroot.user(args, ["cp", apk_path, apk_path + ".buildinfo.json", + temp_path]) # Change the timestamps of all files, so the changes file gets written # correctly, even if this testcase gets executed very fast - pmb.chroot.user(args, ["touch", "-d", "2017-01-01", apk_path, apk_path + - ".buildinfo.json"]) + pmb.chroot.user(args, ["touch", "-d", "2017-01-01", + packages_path + "/APKINDEX.tar.gz", + apk_path, + apk_path + ".buildinfo.json"]) # Challenge, output changes into a file setattr(args, "output_repo_changes", args.work + "/chroot_native/tmp/"