Skip to content

Commit 7a44323

Browse files
macnopichlermarc
andauthored
Update plugins/node/opentelemetry-instrumentation-mysql2/test/mysql.test.ts
Co-authored-by: Marc Pichler <[email protected]>
1 parent b9093ae commit 7a44323

File tree

1 file changed

+4
-1
lines changed
  • plugins/node/opentelemetry-instrumentation-mysql2/test

1 file changed

+4
-1
lines changed

plugins/node/opentelemetry-instrumentation-mysql2/test/mysql.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,10 @@ describe('mysql2', () => {
12501250
let mysqlTypesPromReload: typeof mysqlTypesProm;
12511251

12521252
before(async function () {
1253-
// cleanup cache for mysql2
1253+
// cleanup cache for 'mysql2'
1254+
// in previous iterations these tests would have passed since 'mysql2' was already loaded,
1255+
// but 'mysql2/promise' does not import 'mysql2'. Therefore, if used without ever loading 'mysql2',
1256+
// the relevant code would never get patched.
12541257
delete require.cache[require.resolve('../src')];
12551258
Object.keys(require.cache).forEach(key => {
12561259
if (key.includes('mysql2/')) {

0 commit comments

Comments
 (0)