aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah Rumancik <leah.rumancik@gmail.com>2023-01-30 11:38:09 -0800
committerLeah Rumancik <leah.rumancik@gmail.com>2023-02-15 15:34:37 -0800
commit438ff0e78f84942d10227e74a02383439a34f183 (patch)
tree25fdbe6bc5854bd5d20d35d342e19e5ef58504c2
parent3e0a5a571980f571b90183b3358675d08c7358dc (diff)
downloadxfstests-bld-438ff0e78f84942d10227e74a02383439a34f183.tar.gz
gce-xfstests: always save serial console
With the LTM auto-resume changes, we now recover after a crash or hang. We know when LTM resets a hung VM but we do not know when a test crashes and the VM reboots itself. For now, always save the serial logs. Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
-rw-r--r--test-appliance/files/usr/local/lib/gce-server/ltm/shard.go8
-rw-r--r--test-appliance/files/usr/local/lib/gce-server/ltm/sharder.go11
2 files changed, 10 insertions, 9 deletions
diff --git a/test-appliance/files/usr/local/lib/gce-server/ltm/shard.go b/test-appliance/files/usr/local/lib/gce-server/ltm/shard.go
index 9cc3c125..bef49236 100644
--- a/test-appliance/files/usr/local/lib/gce-server/ltm/shard.go
+++ b/test-appliance/files/usr/local/lib/gce-server/ltm/shard.go
@@ -298,8 +298,7 @@ func (shard *ShardWorker) shutdownOnTimeout(metadata *compute.Metadata) {
/*
finish calls gce-xfstests scripts to fetch and unpack test result files.
-It deletes the results in gs bucket and local serial port output.
-It also determines testResult:
+It deletes the results in gs bucket and determines testResult:
Default VM finishes without issues, test result is found;
Crash VM started running tests but no test result is found;
@@ -336,11 +335,6 @@ func (shard *ShardWorker) finish() {
shard.log.Panic("Failed to find unpacked result files")
}
- if check.FileExists(shard.serialOutputPath) && !shard.vmTimeout {
- err = os.Remove(shard.serialOutputPath)
- check.NoError(err, shard.log, "Failed to remove dir")
- }
-
prefix := fmt.Sprintf("%s/results.%s", shard.sharder.bucketSubdir, shard.resultsName)
_, err = shard.sharder.gce.DeleteFiles(prefix)
check.NoError(err, shard.log, "Failed to delete file")
diff --git a/test-appliance/files/usr/local/lib/gce-server/ltm/sharder.go b/test-appliance/files/usr/local/lib/gce-server/ltm/sharder.go
index ebe28083..95d1f9e6 100644
--- a/test-appliance/files/usr/local/lib/gce-server/ltm/sharder.go
+++ b/test-appliance/files/usr/local/lib/gce-server/ltm/sharder.go
@@ -386,6 +386,7 @@ func (sharder *ShardScheduler) aggResults() {
"unpackedResultsDir": shard.unpackedResultsDir,
})
log.Debug("Moving shard result files into aggregate folder")
+ shardHasResults := false
if check.DirExists(shard.unpackedResultsDir) {
err := os.RemoveAll(sharder.aggDir + shard.shardID)
@@ -394,16 +395,22 @@ func (sharder *ShardScheduler) aggResults() {
err = os.Rename(shard.unpackedResultsDir, sharder.aggDir+shard.shardID)
check.Panic(err, log, "Failed to move dir")
+ shardHasResults = true
hasResults = true
- } else if check.FileExists(shard.serialOutputPath) {
+ }
+
+ if check.FileExists(shard.serialOutputPath) {
err := os.RemoveAll(sharder.aggDir + shard.shardID + ".serial")
check.Panic(err, log, "Failed to remove dir")
err = os.Rename(shard.serialOutputPath, sharder.aggDir+shard.shardID+".serial")
check.Panic(err, log, "Failed to move dir")
+ shardHasResults = true
hasResults = true
- } else {
+ }
+
+ if ! shardHasResults {
log.Warn("Shard has no results available")
}
}