Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unreliable test: ToolkitLogger log tracking can find log from multiple files: #6132

Open
Hweinstock opened this issue Dec 3, 2024 · 0 comments

Comments

@Hweinstock
Copy link
Contributor

Test Details

  • Name of test: ToolkitLogger, log tracking, can find log from multiple files.
  • OS of failure: Windows
  • VSCode version of failure (minimum/insider/stable): stable
  • Link to failing run: https://github.com/aws/aws-toolkit-vscode/actions/runs/12142141015/job/33855905517
  • Link to failing test:
    it('can find log from multiple files', async function () {
    const logIDs: number[] = []
    const filePaths: vscode.Uri[] = []
    const expected: string[] = []
    // Make a bunch of files
    for (let i = 0; i < 4; i++) {
    tempLogPath = vscode.Uri.joinPath(vscode.Uri.file(tempFolder), `temp-tracker-${tempFileCounter++}.log`)
    testLogger.logToFile(tempLogPath)
    filePaths.push(tempLogPath)
    }
    for (let i = 0; i < 10; i++) {
    const errorLog = `error message ${i}`
    logIDs.push(testLogger.error(errorLog))
    expected.push(errorLog)
    }
    await Promise.all(filePaths.map((log) => checkFile(testLogger, log, expected)))
    const middleFile: vscode.Uri = filePaths[Math.floor(filePaths.length / 2)]
    const middleMsg = testLogger.getLogById(logIDs[Math.floor(logIDs.length / 2)], middleFile)
    assert.notStrictEqual(middleMsg, undefined)
    })

Log of Test Failure

 ToolkitLogger
       log tracking
         can find log from multiple files:
     Error: Expected message not found in log: error message 0
Expected message not found in log: error message 1
Expected message not found in log: error message 2
Expected message not found in log: error message 3
Expected message not found in log: error message 4
Expected message not found in log: error message 5
Expected message not found in log: error message 6
Expected message not found in log: error message 7
Expected message not found in log: error message 8
Expected message not found in log: error message 9


 Last 10 log lines:

      at D:\a\aws-toolkit-vscode\aws-toolkit-vscode\packages\core\src\test\shared\logger\toolkitLogger.test.ts:52:17
      at runNextTicks (node:internal/process/task_queues:60:5)
      at listOnTimeout (node:internal/timers:545:9)
      at processTimers (node:internal/timers:519:7)

deleteTestTempDirs: deleted 334 test temp dirs
Error: 1 tests failed.
    at D:\a\aws-toolkit-vscode\aws-toolkit-vscode\packages\core\src\test\testRunner.ts:124:28
    at MultiReporters.done (D:\a\aws-toolkit-vscode\aws-toolkit-vscode\node_modules\mocha-multi-reporters\lib\MultiReporters.js:124:16)
    at done (D:\a\aws-toolkit-vscode\aws-toolkit-vscode\node_modules\mocha\lib\mocha.js:1007:16)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
Extension host test runner error Error: 1 tests failed.
    at D:\a\aws-toolkit-vscode\aws-toolkit-vscode\packages\core\src\test\testRunner.ts:124:28
    at MultiReporters.done (D:\a\aws-toolkit-vscode\aws-toolkit-vscode\node_modules\mocha-multi-reporters\lib\MultiReporters.js:124:16)
    at done (D:\a\aws-toolkit-vscode\aws-toolkit-vscode\node_modules\mocha\lib\mocha.js:1007:16)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Additional Information

@tomcat323 tomcat323 added bug We can reproduce the issue and confirmed it is a bug. and removed bug We can reproduce the issue and confirmed it is a bug. labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants