Remove the minimum value of 1 in RamResourceConverter and delete a test.

This functionality was added to production code solely because some tests used LocalHostCapacity wrong, so I fixed said tests instead.

The test was also bogus because RamResourceConverter used the available RAM when RamResourceConverter was instantiated, which means that its correctness apparently depended on which test cases (if any) were run before this test. I do admit, though, that I haven't investigated very thoroughly what exact mechanism causes RamResourceConverter to be instantiated.

RELNOTES: None.
PiperOrigin-RevId: 249645361
diff --git a/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java b/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java
index 205e5eb..fe41141 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java
@@ -580,11 +580,7 @@
       super(
           ImmutableMap.of(
               "HOST_RAM",
-              // Some tests seem to set local host RAM to 0, so we adjust host RAM to 1 here
-              // to make sure the default is valid.
-              () ->
-                  Math.max(
-                      1, (int) Math.ceil(LocalHostCapacity.getLocalHostCapacity().getMemoryMb()))),
+              () -> (int) Math.ceil(LocalHostCapacity.getLocalHostCapacity().getMemoryMb())),
           1,
           Integer.MAX_VALUE);
     }
diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/JobsConverterTest.java b/src/test/java/com/google/devtools/build/lib/buildtool/JobsConverterTest.java
index 08516d7..a7dca51 100644
--- a/src/test/java/com/google/devtools/build/lib/buildtool/JobsConverterTest.java
+++ b/src/test/java/com/google/devtools/build/lib/buildtool/JobsConverterTest.java
@@ -38,14 +38,14 @@
 
   @Test
   public void testAutoJobsUsesHardwareSettings() throws Exception {
-    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(0, 123));
+    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(1, 123));
     assertThat(jobsConverter.convert("auto")).isEqualTo(123);
   }
 
   @Test
   public void testAutoJobsAdjustsIfHardwareDetectionIsBogus() throws Exception {
     LocalHostCapacity.setLocalHostCapacity(
-        ResourceSet.createWithRamCpu(0, BuildRequestOptions.MAX_JOBS + 1));
+        ResourceSet.createWithRamCpu(1, BuildRequestOptions.MAX_JOBS + 1));
     assertThat(jobsConverter.convert("auto")).isEqualTo(BuildRequestOptions.MAX_JOBS);
   }
 
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/LoadingPhaseThreadsConverterTest.java b/src/test/java/com/google/devtools/build/lib/runtime/LoadingPhaseThreadsConverterTest.java
index 4cd44cf..70d78b8 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/LoadingPhaseThreadsConverterTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/LoadingPhaseThreadsConverterTest.java
@@ -38,13 +38,13 @@
 
   @Test
   public void testAutoLoadingPhaseThreadsUsesHardwareSettings() throws Exception {
-    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(0, 7));
+    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(1, 7));
     assertThat(loadingPhaseThreadCountConverter.convert("auto")).isEqualTo(7);
   }
 
   @Test
   public void testAutoLoadingPhaseThreadsCappedForTests() throws Exception {
-    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(0, 123));
+    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(1, 123));
     assertThat(loadingPhaseThreadCountConverter.convert("auto")).isEqualTo(20);
   }
 
diff --git a/src/test/java/com/google/devtools/build/lib/util/ResourceConverterTest.java b/src/test/java/com/google/devtools/build/lib/util/ResourceConverterTest.java
index 861c570..fb7b0cf 100644
--- a/src/test/java/com/google/devtools/build/lib/util/ResourceConverterTest.java
+++ b/src/test/java/com/google/devtools/build/lib/util/ResourceConverterTest.java
@@ -81,7 +81,7 @@
 
   @Test
   public void convertHostCpus_returnsCpuSetting() throws Exception {
-    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(0, 15));
+    LocalHostCapacity.setLocalHostCapacity(ResourceSet.createWithRamCpu(1, 15));
     resourceConverter = new ResourceConverter(() -> 5);
     assertThat(resourceConverter.convert("HOST_CPUS")).isEqualTo(15);
   }