changeset 50240:3ddff85fa2c8 stable

dirstate: simplify the dirstate's read race testing Now that most code behaves properly, we can simplify the expected matching.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 01 Mar 2023 00:07:26 +0100
parents 491f3dd080eb
children 342c3c4640b7
files tests/test-dirstate-read-race.t
diffstat 1 files changed, 19 insertions(+), 186 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-dirstate-read-race.t	Tue Feb 28 19:36:46 2023 +0100
+++ b/tests/test-dirstate-read-race.t	Wed Mar 01 00:07:26 2023 +0100
@@ -174,26 +174,22 @@
   R dir/nested/m
   ? p
   ? q
-  $ cat $TESTTMP/status-race-lock.log
 #else
-#if rhg
-#if pre-all-read
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/n
-  A dir/o
-  R dir/nested/m
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
-#if dirstate-v2-append
+#if rhg pre-some-read dirstate-v2-append
   $ cat $TESTTMP/status-race-lock.out
   A dir/o
   R dir/nested/m
   ? dir/n
   ? p
   ? q
-  $ cat $TESTTMP/status-race-lock.log
+#else
+#if rust no-rhg dirstate-v2-append
+  $ cat $TESTTMP/status-race-lock.out
+  A dir/o
+  R dir/nested/m
+  ? dir/n
+  ? p
+  ? q
 #else
   $ cat $TESTTMP/status-race-lock.out
   A dir/n
@@ -201,39 +197,10 @@
   R dir/nested/m
   ? p
   ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
-#endif
-#else
-#if rust
-#if dirstate-v2-rewrite
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/n
-  A dir/o
-  R dir/nested/m
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
-#else
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/n
-  A dir/o
-  R dir/nested/m
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
 #endif
 #endif
 #endif
+  $ cat $TESTTMP/status-race-lock.log
 
 final cleanup
 
@@ -282,24 +249,16 @@
 
 The status process should return a consistent result and not crash.
 
-#if dirstate-v1
+#if rust no-rhg dirstate-v2-append
   $ cat $TESTTMP/status-race-lock.out
-  M dir/o (no-rhg !)
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-  warning: ignoring unknown working parent 02a67a77ee9b! (no-rhg !)
-#else
-#if rhg
-#if pre-all-read
-  $ cat $TESTTMP/status-race-lock.out
+  A dir/o
+  R dir/nested/m
   ? dir/n
   ? p
   ? q
   $ cat $TESTTMP/status-race-lock.log
 #else
-#if dirstate-v2-append
+#if rhg pre-some-read dirstate-v2-append
   $ cat $TESTTMP/status-race-lock.out
   A dir/o
   R dir/nested/m
@@ -309,40 +268,12 @@
   $ cat $TESTTMP/status-race-lock.log
 #else
   $ cat $TESTTMP/status-race-lock.out
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
-#endif
-#else
-#if rust
-#if dirstate-v2-rewrite
-  $ cat $TESTTMP/status-race-lock.out
-  M dir/o
+  M dir/o (no-rhg known-bad-output !)
   ? dir/n
   ? p
   ? q
   $ cat $TESTTMP/status-race-lock.log
-  warning: ignoring unknown working parent 02a67a77ee9b!
-#else
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
-#else
-  $ cat $TESTTMP/status-race-lock.out
-  M dir/o
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-  warning: ignoring unknown working parent 02a67a77ee9b!
-#endif
+  warning: ignoring unknown working parent 02a67a77ee9b! (no-rhg !)
 #endif
 #endif
 
@@ -414,24 +345,7 @@
 
 The status process should return a consistent result and not crash.
 
-#if dirstate-v1
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
-#if rhg
-#if pre-all-read
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
-#if dirstate-v2-append
+#if rhg dirstate-v2-append pre-some-read
   $ cat $TESTTMP/status-race-lock.out
   A dir/o
   R dir/nested/m
@@ -444,26 +358,8 @@
   ? dir/n
   ? p
   ? q
-  $ cat $TESTTMP/status-race-lock.log
 #else
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
-#endif
-#else
-#if rust
-#if dirstate-v2-rewrite
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
+#if rust no-rhg dirstate-v2-append
   $ cat $TESTTMP/status-race-lock.out
   A dir/o
   R dir/nested/m
@@ -476,18 +372,15 @@
   ? dir/n
   ? p
   ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
 #else
   $ cat $TESTTMP/status-race-lock.out
   A dir/o
   ? dir/n
   ? p
   ? q
-  $ cat $TESTTMP/status-race-lock.log
 #endif
 #endif
-#endif
+  $ cat $TESTTMP/status-race-lock.log
 
 final cleanup
 
@@ -523,34 +416,6 @@
 
 The status process should return a consistent result and not crash.
 
-#if dirstate-v1
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
-#if rhg
-#if pre-all-read
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
-#if dirstate-v2-append
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
   $ cat $TESTTMP/status-race-lock.out
   A dir/o
   R dir/nested/m
@@ -558,38 +423,6 @@
   ? p
   ? q
   $ cat $TESTTMP/status-race-lock.log
-#endif
-#endif
-#else
-#if rust
-#if dirstate-v2-rewrite
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#else
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
-#else
-  $ cat $TESTTMP/status-race-lock.out
-  A dir/o
-  R dir/nested/m
-  ? dir/n
-  ? p
-  ? q
-  $ cat $TESTTMP/status-race-lock.log
-#endif
-#endif
-#endif
 
 final cleanup