Give the spam classifier test its own upload limits
The quota test, which runs earlier in the same system suite, leaves uploads expiring after one second, at most three at a time, and the spam classifier test inherited that. It imports twenty samples, each an upload followed by an import; when the step between them takes longer than a second, the import fails with BlobNotFound. After the v0.16.25 merge this failed in two runs out of three, where main passed three out of three. Putting back the old midnight rounding of a training sample's deadline (upstream now uses now() + hold, which is now() in this suite since the purge test holds samples for zero seconds) made it pass, so that change is what tips the timing; exactly how it slows the import loop wasn't traced. The test now resets the upload TTL, count and quota to their defaults before it starts. Production isn't affected: uploads are kept for an hour by default and samples for ninety days.
This commit is contained in:
1 parent
db4135e481
commit
b25258330c
1 file changed
+19
-2
@@ -2,6 +2,8 @@
|
||||
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*
|
||||
* Modified by Coffey Labs in 2026 for INBUXA.
|
||||
*/
|
||||
|
||||
use crate::utils::{jmap::JmapUtils, server::TestServer};
|
||||
@@ -11,8 +13,8 @@ use registry::{
|
||||
enums::{Permission, TaskSpamFilterMaintenanceType, TaskStoreMaintenanceType},
|
||||
prelude::{ObjectType, Property},
|
||||
structs::{
|
||||
Permissions, PermissionsList, SpamTrainingSample, Task, TaskSpamFilterMaintenance,
|
||||
TaskStatus, TaskStoreMaintenance,
|
||||
Jmap, Permissions, PermissionsList, SpamTrainingSample, Task,
|
||||
TaskSpamFilterMaintenance, TaskStatus, TaskStoreMaintenance,
|
||||
},
|
||||
},
|
||||
types::map::Map,
|
||||
@@ -26,6 +28,21 @@ pub async fn test(test: &mut TestServer) {
|
||||
|
||||
// Create test accounts
|
||||
let admin = test.account("[email protected]");
|
||||
|
||||
// inbuxa: the quota test leaves uploads expiring after one second, at
|
||||
// most three at a time. This test imports twenty samples, and a debug
|
||||
// build can take longer than that between upload and import.
|
||||
admin
|
||||
.registry_update_setting(
|
||||
Jmap::default(),
|
||||
&[
|
||||
Property::UploadQuota,
|
||||
Property::MaxUploadCount,
|
||||
Property::UploadTtl,
|
||||
],
|
||||
)
|
||||
.await;
|
||||
admin.reload_settings().await;
|
||||
let account = test
|
||||
.create_user_account(
|
||||
"[email protected]",
|
||||
|
||||
Reference in new issue
Block a user