19166: Fix logging noise in test suite.
authorTom Clegg <tom@curii.com>
Fri, 17 Jun 2022 17:41:50 +0000 (13:41 -0400)
committerTom Clegg <tom@curii.com>
Fri, 24 Jun 2022 18:23:25 +0000 (14:23 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/crunchrun/integration_test.go
sdk/python/tests/run_test_server.py

index 3f7c7e50f14f7713c0de4885f0cae4fd64ab11f8..a18829f30d24d8a66673b8ed1fa073124eb13518 100644 (file)
@@ -224,13 +224,25 @@ func (s *integrationSuite) TestRunTrivialContainerWithLocalKeepstore(c *C) {
                        c.Check(log, trial.matchPutReq, `(?ms).*"reqMethod":"PUT".*,"reqPath":"0e3bcff26d51c895a60ea0d4585e134d".*`)
                }
        }
+}
 
+func (s *integrationSuite) TestRunTrivialContainerWithNoLocalKeepstore(c *C) {
        // Check that (1) config is loaded from $ARVADOS_CONFIG when
        // not provided on stdin and (2) if a local keepstore is not
        // started, crunch-run.txt explains why not.
        s.SetUpTest(c)
        s.stdin.Reset()
        s.testRunTrivialContainer(c)
+       c.Check(s.logFiles["crunch-run.txt"], Matches, `(?ms).*not starting a local keepstore process because KeepBuffers=0 in config\n.*`)
+
+       s.SetUpTest(c)
+       s.args = []string{"-config", c.MkDir() + "/config.yaml"}
+       s.stdin.Reset()
+       buf, err := ioutil.ReadFile(os.Getenv("ARVADOS_CONFIG"))
+       c.Assert(err, IsNil)
+       err = ioutil.WriteFile(s.args[1], bytes.Replace(buf, []byte("LocalKeepBlobBuffersPerVCPU: 0"), []byte("LocalKeepBlobBuffersPerVCPU: 1"), -1), 0666)
+       c.Assert(err, IsNil)
+       s.testRunTrivialContainer(c)
        c.Check(s.logFiles["crunch-run.txt"], Matches, `(?ms).*not starting a local keepstore process because a volume \(zzzzz-nyw5e-00000000000000\d\) uses AccessViaHosts\n.*`)
 
        // Check that config read errors are logged
@@ -243,7 +255,7 @@ func (s *integrationSuite) TestRunTrivialContainerWithLocalKeepstore(c *C) {
        s.SetUpTest(c)
        s.args = []string{"-config", c.MkDir() + "/config-unreadable.yaml"}
        s.stdin.Reset()
-       err := ioutil.WriteFile(s.args[1], []byte{}, 0)
+       err = ioutil.WriteFile(s.args[1], []byte{}, 0)
        c.Check(err, IsNil)
        s.testRunTrivialContainer(c)
        c.Check(s.logFiles["crunch-run.txt"], Matches, `(?ms).*could not load config file \Q`+s.args[1]+`\E:.* permission denied\n.*`)
index 2c01b35aeac79b1642b18c7af7d166ef2cffdc3c..2b6684ff570b35f7ca6dcc2d30e3d6dc4cb2bf56 100644 (file)
@@ -830,6 +830,7 @@ def setup_config():
                     "JobsAPI": {
                         "GitInternalDir": os.path.join(SERVICES_SRC_DIR, 'api', 'tmp', 'internal.git'),
                     },
+                    "LocalKeepBlobBuffersPerVCPU": 0,
                     "SupportedDockerImageFormats": {"v1": {}},
                     "ShellAccess": {
                         "Admin": True,