Unverified Commit 3abf1463 authored by Lemon-miaow's avatar Lemon-miaow
Browse files

test(cli): 服务器清单导出期限测试给第一次调用留够启动时间,忙时不再误报

parent 5dffadb4
Loading
Loading
Loading
Loading
+4 −1
Changes for cmd/felis/db_test.go: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -551,7 +551,10 @@ func TestPreMigrateBackupExportsServers(t *testing.T) {
func TestServerExportStopsWaitingWithTheContext(t *testing.T) {
	dir := newPodRig(t)
	writeTestFile(t, filepath.Join(dir, "servers_fail"), "99", 0o600)
	ctx, cancel := context.WithTimeout(context.Background(), 300*time.Millisecond)
	// Long enough for the first try to run to its refusal: starting the fake
	// k3s on a busy machine can take a few hundred ms. Still far below the
	// 10s retry wait, so waiting it out would fail the check below.
	ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
	defer cancel()
	start := time.Now()
	_, err := exportMinecraftServers(ctx)