question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Component test fails on 2nd run when SSL is used

See original GitHub issue

Context:

  • Playwright Version: "playwright/experimental-ct-svelte": "^1.24.2"
  • Operating System: macOS
  • Node.js version: 16.14.2
  • Browser: All
  • Extra: ARM chip device

Code Snippet

Here’s the reduced test case which reproduces the issue: https://github.com/vhscom/playwright-ct-ssl-reduced-test

I’ve left the reduced test case configured with the Vite plugin for SSL but the issue can be reproduced without plugins specified in the Playwright component config file.

Describe the bug

This is an extension of https://github.com/microsoft/playwright/issues/16424. When testing a Svelte component using @vitejs/plugin-basic-ssl plugin test runner fails with error message when cache is present and unless the component under test has a timestamp modification (read: it was saved, even without changes):

undefined: net::ERR_EMPTY_RESPONSE at http://localhost:3100/playwright/index.html
=========================== logs ===========================
navigating to "http://localhost:3100/playwright/index.html", waiting until "load"
============================================================

I narrowed it down to a TLS/vite config/playwright lib corner case. It seems the URL under test does not work when the @vitejs/plugin-basic-ssl plugin is used—but only on the second run if the component under test doesn’t have a timestamp modification since the last cached run.

Ideally tests will either fail wholesale if SSL is configured or there will be a way to run component tests over the https scheme—which would be expected when the plug-in is configured via Playwright experimental ctViteConfig prop. Having test runs once, fail on the second run, then work again when the cache is cleared or the component timestamp changed is unexpected behavior.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rwollcommented, Aug 11, 2022

Sweet—I’m going to assign this a milestone and owner to take a more holistic look to see if there’s something we can/should do differently, but at least there’s a workaround for you until then! (It may be resolved as Won’t Fix, but want another pair of eyes @pavelfeldman)

1reaction
rwollcommented, Aug 11, 2022

I’ll start thinking about a way to branch the primary vite config

I’m trying something out. If it works, I’ll send you a diff.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Dreaded SSLException Error and What You Can Do ...
If the client is performing an HTTPS request to the server, and an error occurs, then an SSL Exception will appear in the...
Read more >
HTTP Server Test Fails with SSL Error
If the error occurs when the test is run from either ThousandEyes Cloud Agents or Enterprise Agents, the cause of the error is...
Read more >
SSL Connections Issues when running Unit Tests from the ...
The test fails due to the "The certificate for this server is invalid." error. Any Pointers? Am I doing it wrong? Is this...
Read more >
Troubleshooting SSL related issues (Server Certificate)
The problem is seen because the SSL handshake failed and hence the error message was seen. There could be many reasons.
Read more >
How to Handle SSL Certificate in Selenium WebDriver with ...
Have you ever wondered why this happens? The answer is simple, on manually opening a URL, the browser automatically imports the required ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found