diff --git a/lib/modules/manager/bundler/artifacts.spec.ts b/lib/modules/manager/bundler/artifacts.spec.ts
index df9b06bdad2c7733268322d6540dba32692f692d..a9997153188c798803aa378fe26ef854b2eca147 100644
--- a/lib/modules/manager/bundler/artifacts.spec.ts
+++ b/lib/modules/manager/bundler/artifacts.spec.ts
@@ -53,8 +53,6 @@ const updatedGemfileLock = {
 describe('modules/manager/bundler/artifacts', () => {
   describe('updateArtifacts', () => {
     beforeEach(() => {
-      jest.resetModules();
-
       delete process.env.GEM_HOME;
 
       env.getChildProcessEnv.mockReturnValue(envMock.basic);
diff --git a/lib/util/exec/containerbase.ts b/lib/util/exec/containerbase.ts
index 5a27d1dd0d2082d8a8ffd6f9cc0fcbee0db7a62f..3df791e8dfe3a8bfda927bf731747acd6e4e244e 100644
--- a/lib/util/exec/containerbase.ts
+++ b/lib/util/exec/containerbase.ts
@@ -2,7 +2,7 @@ import is from '@sindresorhus/is';
 import { quote } from 'shlex';
 import { GlobalConfig } from '../../config/global';
 import { logger } from '../../logger';
-import { getPkgReleases } from '../../modules/datasource';
+import type { ReleaseResult } from '../../modules/datasource';
 import * as allVersioning from '../../modules/versioning';
 import { id as composerVersioningId } from '../../modules/versioning/composer';
 import { id as gradleVersioningId } from '../../modules/versioning/gradle';
@@ -198,6 +198,19 @@ const allToolConfig: Record<string, ToolConfig> = {
   },
 };
 
+let _getPkgReleases: Promise<typeof import('../../modules/datasource')> | null =
+  null;
+
+async function getPkgReleases(
+  toolConfig: ToolConfig,
+): Promise<ReleaseResult | null> {
+  if (_getPkgReleases === null) {
+    _getPkgReleases = import('../../modules/datasource');
+  }
+  const { getPkgReleases } = await _getPkgReleases;
+  return getPkgReleases(toolConfig);
+}
+
 export function supportsDynamicInstall(toolName: string): boolean {
   return !!allToolConfig[toolName];
 }
diff --git a/lib/util/exec/index.spec.ts b/lib/util/exec/index.spec.ts
index 68616cbf372216d6077141fd781dbc02d6dd1d5a..3e3385b44204de6e7ffe481f451e627e303134a0 100644
--- a/lib/util/exec/index.spec.ts
+++ b/lib/util/exec/index.spec.ts
@@ -47,7 +47,6 @@ describe('util/exec/index', () => {
   beforeEach(() => {
     dockerModule.resetPrefetchedImages();
     jest.restoreAllMocks();
-    jest.resetModules();
     processEnvOrig = process.env;
     GlobalConfig.reset();
   });
diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts
index 3e36ab49fff75fee2c02d47d652c7e409e39c711..c2be59f4a42910741bc1ddd0deb95e56c3696e9d 100644
--- a/lib/util/git/index.spec.ts
+++ b/lib/util/git/index.spec.ts
@@ -95,7 +95,6 @@ describe('util/git/index', () => {
   const OLD_ENV = process.env;
 
   beforeEach(async () => {
-    jest.resetModules();
     process.env = { ...OLD_ENV };
     origin = await tmp.dir({ unsafeCleanup: true });
     const repo = Git(origin.path);
diff --git a/lib/util/object.spec.ts b/lib/util/object.spec.ts
index 046c7c0f47292431a550927eabf081562bee533f..ab2f62d0df222d49deda8f01821cacefe76b791c 100644
--- a/lib/util/object.spec.ts
+++ b/lib/util/object.spec.ts
@@ -1,10 +1,6 @@
 import { coerceObject, hasKey } from './object';
 
 describe('util/object', () => {
-  beforeEach(() => {
-    jest.resetModules();
-  });
-
   it('finds key in regular object', () => {
     expect(hasKey('foo', { foo: true })).toBeTrue();
   });