"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: got-build-regress.sh regress failure
To:
op@omarpolo.com
Cc:
gameoftrees@openbsd.org
Date:
Thu, 20 Jul 2023 01:26:00 +1000

Download raw body.

Thread
op@omarpolo.com wrote:
> got-build-regress.sh for branch 'main' on Wed Jul 19 14:29:06 UTC 2023
> 
> Running on OpenBSD 7.3-current (GENERIC.MP) #815: Thu Jul  6 12:01:38 MDT 2023
>     deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
> 
> 
> 	Cleaning the work tree
> 
> ===> regress/tog
> ==== log ====
> ./log.sh -q -r "/home/chiaki/tmp/"
> 
> ==== diff ====
> ./diff.sh -q -r "/home/chiaki/tmp/"
> --- /home/chiaki/tmp/tog-test-diff_commit_keywords-6fMQf1yBE8/view.expected	Wed Jul 19 16:58:26 2023
> +++ /home/chiaki/tmp/tog-test-diff_commit_keywords-6fMQf1yBE8/view	Wed Jul 19 16:58:27 2023
> @@ -1,7 +1,7 @@
>  [1/20] diff 2d708bde55b47848cae705fdbf2aaabe78eb2e68 5e24cb83c39b6290e3af6583054436a2a2a132b6
>  commit 5e24cb83c39b6290e3af6583054436a2a2a132b6
>  from: Flan Hacker <flan_hacker@openbsd.org>
> -date: Wed Jul 19 14:58:20 2023 UTC
> +date: Wed Jul 19 14:58:21 2023 UTC
>  
>  commit 1
>  
> test failed; leaving test data in /home/chiaki/tmp/tog-test-diff_commit_keywords-6fMQf1yBE8
> *** Error 1 in regress/tog (Makefile:10 'diff')
> FAILED
> 
> ==== blame ====
> ./blame.sh -q -r "/home/chiaki/tmp/"
> 
> ==== tree ====
> ./tree.sh -q -r "/home/chiaki/tmp/"
> 
> 
> 
> 	 Test failures:
> 
> test failed; leaving test data in /home/chiaki/tmp/tog-test-diff_commit_keywords-6fMQf1yBE8

Ah, the commit time is off by a second!

I can actually reproduce this one in every ~10 runs too. Right after
release, too, just like clockwork! Sorry, stsp :/

The below fixes it for me.

Please commit if ok. It's late here and I'm off to zzz.


-----------------------------------------------
commit 06338560ee7435c03a87156be611ad0762b3396c (main)
from: Mark Jamsek <mark@jamsek.dev>
date: Wed Jul 19 15:19:13 2023 UTC
 
 tog regress: fix date seconds discrepancy in expected diff view
 
 M  regress/tog/diff.sh  |  5+  3-

1 file changed, 5 insertions(+), 3 deletions(-)

diff 7ee43e4fb8c1b89b2cff391213f1a90051fac919 06338560ee7435c03a87156be611ad0762b3396c
commit - 7ee43e4fb8c1b89b2cff391213f1a90051fac919
commit + 06338560ee7435c03a87156be611ad0762b3396c
blob - 6ab39dc440fb2afb20ecaabc0425b545530d6c6d
blob + 38287ad91c7e0eeaf2c7f133935f5622968b42dd
--- regress/tog/diff.sh
+++ regress/tog/diff.sh
@@ -212,10 +212,10 @@ test_diff_commit_keywords()
 	local wt="$testroot/wt"
 	local id=$(git_show_head "$repo")
 	local author_time=$(git_show_author_time "$repo")
-	local date=$(date -u -r $author_time +"%a %b %e %X %Y UTC")
 
 	set -A ids "$id"
 	set -A alpha_ids $(get_blob_id "$repo" "" alpha)
+	set -A dates "$author_time"
 
 	got checkout "$repo" "$wt" > /dev/null
 	ret=$?
@@ -244,6 +244,8 @@ test_diff_commit_keywords()
 		ids=$*
 		set -- "$alpha_ids" "$(get_blob_id "$repo" "" alpha)"
 		alpha_ids=$*
+		set -- "$dates" $(git_show_author_time "$repo")
+		dates=$*
 	done
 
 	cat <<-EOF >$TOG_TEST_SCRIPT
@@ -253,6 +255,7 @@ test_diff_commit_keywords()
 	# diff consecutive commits with keywords
 	local lhs_id=$(pop_id 1 $ids)
 	local rhs_id=$(pop_id 2 $ids)
+	local date=$(date -u -r $(pop_id 2 $dates) +"%a %b %e %X %Y UTC")
 
 	cat <<-EOF >$testroot/view.expected
 	[1/20] diff $lhs_id $rhs_id
@@ -333,8 +336,7 @@ test_diff_commit_keywords()
 	# diff consecutive commits using keywords with -r repository
 	lhs_id=$(pop_id 8 $ids)
 	rhs_id=$(pop_id 9 $ids)
-	author_time=$(git_show_author_time "$repo")
-	date=$(date -u -r $author_time +"%a %b %e %X %Y UTC")
+	date=$(date -u -r $(pop_id 9 $dates) +"%a %b %e %X %Y UTC")
 
 	cat <<-EOF >$testroot/view.expected
 	[1/20] diff $lhs_id refs/heads/master



-- 
Mark Jamsek <https://bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68