mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
test/pylib: scylla_cluster: mark cluster as dirty if it fails to boot
If a cluster fails to boot, it saves the exception in
`self.start_exception` variable; the exception will be rethrown when
a test tries to start using this cluster. As explained in `before_test`:
```
def before_test(self, name) -> None:
"""Check that the cluster is ready for a test. If
there was a start error, throw it here - the server is
running when it's added to the pool, which can't be attributed
to any specific test, throwing it here would stop a specific
test."""
```
It's arguable whether we should blame some random test for a failure
that it didn't cause, but nevertheless, there's a problem here: the
`start_exception` will be rethrown and the test will fail, but then the
cluster will be simply returned to the pool and the next test will
attempt to use it... and so on.
Prevent this by marking the cluster as dirty the first time we rethrow
the exception.
Closes #12560
(cherry picked from commit 147dd73996)
This commit is contained in:
@@ -706,6 +706,8 @@ class ScyllaCluster:
|
||||
to any specific test, throwing it here would stop a specific
|
||||
test."""
|
||||
if self.start_exception:
|
||||
# Mark as dirty so further test cases don't try to reuse this cluster.
|
||||
self.is_dirty = True
|
||||
raise self.start_exception
|
||||
|
||||
for server in self.running.values():
|
||||
|
||||
Reference in New Issue
Block a user