Skip to content

Commit

Permalink
Update the docs for e2e tests with a custom FDB version (#2146)
Browse files Browse the repository at this point in the history
  • Loading branch information
johscheuer authored Oct 15, 2024
1 parent 4a7ea2a commit 232da61
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
17 changes: 17 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ FDB_VERSION="7.3.38" \
make -C e2e test_operator.run
```

### Running the e2e tests with a custom FDB version

The operator e2e tests support to run with custom FDB versions that are not yet released.
The next steps assume that you are able to build a container image for FDB with a custom version.
The `UPGRADE_VERSIONS` defines which versions should be used for the upgrade tests.
The `FDB_VERSION_TAG_MAPPING` provides a way to overwrite the image tag that will be used for the specific tag.
If you use the [split image](../docs/manual/technical_design.md#split-image) you have to build the main `foundationdb` image and the `foundationdb-kubernetes-sidecar` image.
If you use the [unified image](../docs/manual/technical_design.md#unified-image) you only have to build the `fdb-kubernetes-monitor` image.
You have to make sure that the version used in the `FDB_VERSION_TAG_MAPPING` maps to the actual `fdbserver` version in the container image, otherwise some checks will fail because the actual running server is in a different version that the expected version.

```bash
FDB_VERSION="7.3.43" \
UPGRADE_VERSIONS="7.3.43:7.3.52" \
FDB_VERSION_TAG_MAPPING="7.3.52:7.3.52-custom-build" \
make -C e2e test_operator_upgrades.run
```

### Running e2e tests in kind

_NOTE_ This setup is currently not used by our CI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func clusterSetupWithConfig(config testConfig) *fixtures.FdbCluster {
func performUpgrade(config testConfig, preUpgradeFunction func(cluster *fixtures.FdbCluster)) {
fdbCluster = clusterSetupWithConfig(config)
startTime := time.Now()
loggingTime := time.Now()
preUpgradeFunction(fdbCluster)
Expect(fdbCluster.UpgradeCluster(config.targetVersion, false)).NotTo(HaveOccurred())

Expand All @@ -96,8 +97,9 @@ func performUpgrade(config testConfig, preUpgradeFunction func(cluster *fixtures

Eventually(func() bool {
// If the status is not updated after 5 minutes try a force reconciliation.
if time.Since(startTime) > 5*time.Minute {
if time.Since(loggingTime) > 5*time.Minute {
fdbCluster.ForceReconcile()
loggingTime = time.Now()
}

for _, processGroup := range fdbCluster.GetCluster().Status.ProcessGroups {
Expand All @@ -110,6 +112,7 @@ func performUpgrade(config testConfig, preUpgradeFunction func(cluster *fixtures
}).WithTimeout(10 * time.Minute).WithPolling(5 * time.Second).Should(BeTrue())
}

loggingTime = time.Now()
transactionSystemProcessGroups := make(map[fdbv1beta2.ProcessGroupID]fdbv1beta2.None)
// Wait until the cluster is upgraded and fully reconciled.
Expect(fdbCluster.WaitUntilWithForceReconcile(2, 1500, func(cluster *fdbv1beta2.FoundationDBCluster) bool {
Expand All @@ -134,6 +137,12 @@ func performUpgrade(config testConfig, preUpgradeFunction func(cluster *fixtures
transactionSystemProcessGroups[processGroup.ProcessGroupID] = fdbv1beta2.None{}
}

// If the cluster is not upgraded after 5 minutes print out the running and the expected version.
if time.Since(loggingTime) > 5*time.Minute {
log.Println("current running version:", cluster.Status.RunningVersion, "expected running version:", config.targetVersion)
loggingTime = time.Now()
}

// Allow soft reconciliation and make sure the running version was updated
return cluster.Status.Generations.Reconciled == cluster.Generation && cluster.Status.RunningVersion == config.targetVersion
})).NotTo(HaveOccurred())
Expand Down

0 comments on commit 232da61

Please sign in to comment.