Skip to content

[BUG] trace does not show that test timed out #23488

Open
@yury-s

Description

@yury-s

Running the following test locally produces trace.zip that does not contain timeout error:

test('should stop tracing on requestContext.dispose()', async ({ runInlineTest, server }) => {
  server.setRoute('/slow', (req, resp) => {
    resp.writeHead(200, {
      'Content-Type': 'text/plain; charset=utf-8',
      'Content-Length': '3',
    });
  });
  const result = await runInlineTest({
    'playwright.config.ts': `
      module.exports = {
        reporter: [['html', { open: 'never' }]],
        use: {
          browserName: 'firefox',
          trace:'retain-on-failure'
        }
      };
    `,
    'a.test.ts': `
      import { test, expect } from '@playwright/test';
      test('hanging request', async ({ page, request }) => {
        const response = await page.goto('${server.EMPTY_PAGE}');
        expect(response.status()).toBe(200);
        await request.get('${server.PREFIX}/slow');
      });
    `,
  }, { workers: 1, timeout: 1000 });
  expect(result.output).not.toContain('ENOENT');
  expect(result.exitCode).toBe(1);
  expect(result.failed).toBe(1);
});

Also some of the test steps are displayed after After Hooks:

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions