Change test flags from common to build

PiperOrigin-RevId: 527028530
Change-Id: I2ad125f2def28528e0087627f8902f2c41d51cf7
diff --git a/src/test/py/bazel/bzlmod/bazel_lockfile_test.py b/src/test/py/bazel/bzlmod/bazel_lockfile_test.py
index 3568ea6..66b029f 100644
--- a/src/test/py/bazel/bzlmod/bazel_lockfile_test.py
+++ b/src/test/py/bazel/bzlmod/bazel_lockfile_test.py
@@ -43,16 +43,16 @@
         [
             # In ipv6 only network, this has to be enabled.
             # 'startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true',
-            'common --enable_bzlmod',
-            'common --registry=' + self.main_registry.getURL(),
+            'build --enable_bzlmod',
+            'build --registry=' + self.main_registry.getURL(),
             # We need to have BCR here to make sure built-in modules like
             # bazel_tools can work.
-            'common --registry=https://bcr.bazel.build',
-            'common --verbose_failures',
+            'build --registry=https://bcr.bazel.build',
+            'build --verbose_failures',
             # Set an explicit Java language version
-            'common --java_language_version=8',
-            'common --tool_java_language_version=8',
-            'common --lockfile_mode=update',
+            'build --java_language_version=8',
+            'build --tool_java_language_version=8',
+            'build --lockfile_mode=update',
         ],
     )
     self.ScratchFile('WORKSPACE')
@@ -85,8 +85,8 @@
     module_dir = self.main_registry.root.joinpath('modules', 'sss', '1.3')
     scratchFile(module_dir.joinpath('MODULE.bazel'), ['whatever!'])
 
-    # Clean bazel to empty any cache of the deps tree
-    self.RunBazel(['clean', '--expunge'])
+    # Shutdown bazel to empty any cache of the deps tree
+    self.RunBazel(['shutdown'])
     # Runing again will try to get 'sss' which should produce an error
     exit_code, _, stderr = self.RunBazel(
         [
@@ -130,8 +130,8 @@
     module_dir = self.main_registry.root.joinpath('modules', 'sss', '1.3')
     scratchFile(module_dir.joinpath('MODULE.bazel'), ['whatever!'])
 
-    # Clean bazel to empty any cache of the deps tree
-    self.RunBazel(['clean', '--expunge'])
+    # Shutdown bazel to empty any cache of the deps tree
+    self.RunBazel(['shutdown'])
     # Running with the lockfile, should not recognize the registry changes
     # hence find no errors
     self.RunBazel(['build', '--nobuild', '//:all'], allow_failure=False)
@@ -156,8 +156,8 @@
     module_dir = self.main_registry.root.joinpath('modules', 'sss', '1.3')
     scratchFile(module_dir.joinpath('MODULE.bazel'), ['whatever!'])
 
-    # Clean bazel to empty any cache of the deps tree
-    self.RunBazel(['clean', '--expunge'])
+    # Shutdown bazel to empty any cache of the deps tree
+    self.RunBazel(['shutdown'])
     # Running with the lockfile, but adding a flag should cause resolution rerun
     exit_code, _, stderr = self.RunBazel(
         [
diff --git a/src/test/py/bazel/bzlmod/bazel_module_test.py b/src/test/py/bazel/bzlmod/bazel_module_test.py
index 6d46bba..878d3ec 100644
--- a/src/test/py/bazel/bzlmod/bazel_module_test.py
+++ b/src/test/py/bazel/bzlmod/bazel_module_test.py
@@ -45,16 +45,16 @@
         [
             # In ipv6 only network, this has to be enabled.
             # 'startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true',
-            'common --enable_bzlmod',
-            'common --registry=' + self.main_registry.getURL(),
+            'build --enable_bzlmod',
+            'build --registry=' + self.main_registry.getURL(),
             # We need to have BCR here to make sure built-in modules like
             # bazel_tools can work.
-            'common --registry=https://bcr.bazel.build',
-            'common --verbose_failures',
+            'build --registry=https://bcr.bazel.build',
+            'build --verbose_failures',
             # Set an explicit Java language version
-            'common --java_language_version=8',
-            'common --tool_java_language_version=8',
-            'common --lockfile_mode=update',
+            'build --java_language_version=8',
+            'build --tool_java_language_version=8',
+            'build --lockfile_mode=update',
         ],
     )
     self.ScratchFile('WORKSPACE')
diff --git a/src/test/py/bazel/bzlmod/bazel_overrides_test.py b/src/test/py/bazel/bzlmod/bazel_overrides_test.py
index 9ec48c3..05ae899 100644
--- a/src/test/py/bazel/bzlmod/bazel_overrides_test.py
+++ b/src/test/py/bazel/bzlmod/bazel_overrides_test.py
@@ -42,16 +42,16 @@
         [
             # In ipv6 only network, this has to be enabled.
             # 'startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true',
-            'common --enable_bzlmod',
-            'common --registry=' + self.main_registry.getURL(),
+            'build --enable_bzlmod',
+            'build --registry=' + self.main_registry.getURL(),
             # We need to have BCR here to make sure built-in modules like
             # bazel_tools can work.
-            'common --registry=https://bcr.bazel.build',
-            'common --verbose_failures',
+            'build --registry=https://bcr.bazel.build',
+            'build --verbose_failures',
             # Set an explicit Java language version
-            'common --java_language_version=8',
-            'common --tool_java_language_version=8',
-            'common --lockfile_mode=update',
+            'build --java_language_version=8',
+            'build --tool_java_language_version=8',
+            'build --lockfile_mode=update',
         ],
     )
     self.ScratchFile('WORKSPACE')
diff --git a/src/test/py/bazel/bzlmod/bazel_repo_mapping_test.py b/src/test/py/bazel/bzlmod/bazel_repo_mapping_test.py
index 2d992d0..d556f07 100644
--- a/src/test/py/bazel/bzlmod/bazel_repo_mapping_test.py
+++ b/src/test/py/bazel/bzlmod/bazel_repo_mapping_test.py
@@ -43,16 +43,16 @@
         [
             # In ipv6 only network, this has to be enabled.
             # 'startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true',
-            'common --enable_bzlmod',
-            'common --registry=' + self.main_registry.getURL(),
+            'build --enable_bzlmod',
+            'build --registry=' + self.main_registry.getURL(),
             # We need to have BCR here to make sure built-in modules like
             # bazel_tools can work.
-            'common --registry=https://bcr.bazel.build',
-            'common --verbose_failures',
+            'build --registry=https://bcr.bazel.build',
+            'build --verbose_failures',
             # Set an explicit Java language version
-            'common --java_language_version=8',
-            'common --tool_java_language_version=8',
-            'common --lockfile_mode=update',
+            'build --java_language_version=8',
+            'build --tool_java_language_version=8',
+            'build --lockfile_mode=update',
         ],
     )
     self.ScratchFile('WORKSPACE')
diff --git a/src/test/py/bazel/bzlmod/bazel_yanked_versions_test.py b/src/test/py/bazel/bzlmod/bazel_yanked_versions_test.py
index 52fa897..21629a0 100644
--- a/src/test/py/bazel/bzlmod/bazel_yanked_versions_test.py
+++ b/src/test/py/bazel/bzlmod/bazel_yanked_versions_test.py
@@ -61,22 +61,22 @@
         [
             # In ipv6 only network, this has to be enabled.
             # 'startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true',
-            'common --enable_bzlmod',
-            'common --registry=' + self.main_registry.getURL(),
+            'build --enable_bzlmod',
+            'build --registry=' + self.main_registry.getURL(),
             # We need to have BCR here to make sure built-in modules like
             # bazel_tools can work.
-            'common --registry=https://bcr.bazel.build',
-            'common --verbose_failures',
+            'build --registry=https://bcr.bazel.build',
+            'build --verbose_failures',
             # Set an explicit Java language version
-            'common --java_language_version=8',
-            'common --tool_java_language_version=8',
-            'common --lockfile_mode=update',
+            'build --java_language_version=8',
+            'build --tool_java_language_version=8',
+            'build --lockfile_mode=update',
         ]
         + (
             [
                 # Disable yanked version check so we are not affected BCR
                 # changes.
-                'common --allow_yanked_versions=all',
+                'build --allow_yanked_versions=all',
             ]
             if allow_yanked_versions
             else []
diff --git a/src/test/py/bazel/bzlmod/bzlmod_query_test.py b/src/test/py/bazel/bzlmod/bzlmod_query_test.py
index c1a72fd..fce2dc7 100644
--- a/src/test/py/bazel/bzlmod/bzlmod_query_test.py
+++ b/src/test/py/bazel/bzlmod/bzlmod_query_test.py
@@ -47,7 +47,8 @@
             'common --registry=https://bcr.bazel.build',
             # Disable yanked version check so we are not affected BCR changes.
             'common --allow_yanked_versions=all',
-        ])
+        ],
+    )
     self.ScratchFile('WORKSPACE')
     # The existence of WORKSPACE.bzlmod prevents WORKSPACE prefixes or suffixes
     # from being used; this allows us to test built-in modules actually work