fix test_gc_cutoff test

Also improve it so it fails earlier if something is not working
because otherwise it was failing because of the timeout.
And if timeout was big enough test can even pass
This commit is contained in:
Dmitry Rodionov
2022-11-10 19:17:29 +02:00
parent 795c3ca131
commit c631fa1f50
2 changed files with 5 additions and 8 deletions

View File

@@ -538,9 +538,7 @@ impl Tenant {
// We're ready for business.
// Change to active state under the hood spawns background loops
// The loops will shut themselves down when they notice that the tenant is inactive.
self.set_state(TenantState::Active {
background_jobs_running: true,
});
self.activate(true);
info!("Done");
@@ -777,9 +775,7 @@ impl Tenant {
// We're ready for business.
// Change to active state under the hood spawns background loops
// The loops will shut themselves down when they notice that the tenant is inactive.
self.set_state(TenantState::Active {
background_jobs_running: true,
});
self.activate(true);
info!("Done");

View File

@@ -307,10 +307,11 @@ pub fn create_tenant(
hash_map::Entry::Vacant(v) => {
let wal_redo_manager = Arc::new(PostgresRedoManager::new(conf, tenant_id));
create_tenant_files(conf, tenant_conf, tenant_id)?;
// TODO review, created in active state immediately, is it correctly?
// create tenant in Active state so it is possible to issue create_timeline
// request. Which on timeline activation will trigger tenant activation
let tenant = Arc::new(Tenant::new(
TenantState::Active {
background_jobs_running: true,
background_jobs_running: false,
},
conf,
tenant_conf,