From 3642a53f20ff0a78e11b7274d2298651cb77d929 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Tue, 20 Jun 2017 19:10:13 +0200 Subject: [PATCH] Fix race condition in testcase test_challenge_build --- test/test_challenge_build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test_challenge_build.py b/test/test_challenge_build.py index c6d9c136..e7a03c29 100644 --- a/test/test_challenge_build.py +++ b/test/test_challenge_build.py @@ -54,6 +54,11 @@ def test_challenge_build(args): 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"]) + # Challenge, output changes into a file setattr(args, "output_repo_changes", args.work + "/chroot_native/tmp/" "test_challenge_build_output.txt") @@ -64,4 +69,5 @@ def test_challenge_build(args): with open(args.output_repo_changes, "r") as handle: lines = handle.readlines() assert lines == [args.arch_native + "/APKINDEX.tar.gz\n", - args.arch_native + "/" + pkgname + "-" + version + ".apk\n"] + args.arch_native + "/" + pkgname + "-" + version + ".apk\n", + args.arch_native + "/" + pkgname + "-" + version + ".apk.buildinfo.json\n"]