Behat 停止工作 SSL 错误 fwrite() laravel

Behat stopped working SSL error fwrite() laravel

我正在使用 behat laravel,但不知何故它停止工作了。 我已经搜索过这个错误,但我还没有找到任何解决方案; 我不断收到此错误

[ErrorException]
  fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
  error:1409F07F:SSL routines:ssl3_write_pending:bad write retry

谁能帮我解决这个问题?

代码不是问题,它读取了 X 行然后只是说它找不到我在该行上放置的内容是否存在无关紧要。

 And I follow "Gebruiker aanmaken"                                  # FeatureContext::clickLink()
    Then I should see "Nieuwe gebruiker aanmaken"                      # FeatureContext::assertPageContainsText()
    And I fill in "Voornaam" with "Jesse"                              # FeatureContext::fillField()
    And I fill in "Achternaam" with "Bessem"                           # FeatureContext::fillField()
    And I fill in "E-Mailadres" with "jesse@jbdevv.nl"                 # FeatureContext::fillField()
    And I fill in "Functie" with "Eigenaar"                            # FeatureContext::fillField()
    And I fill in "Geboortedatum" with "14-07-1994"                    # FeatureContext::fillField()
    And I click on submit button "Aanmaken"                            # FeatureContext::iClickOnSubmitButton()
    Then I should not see "Nieuwe gebruiker aanmaken"                  # FeatureContext::assertPageNotContainsText()
    And I should see "Jesse"                                           # FeatureContext::assertPageContainsText()
    And I should see "Bessem"                                          # FeatureContext::assertPageContainsText()
      The text "Bessem" was not found anywhere in the text of the current page. (Behat\Mink\Exception\ResponseTextException)
    And I should see "jesse@jbdevv.nl"                                 # FeatureContext::assertPageContainsText()
    And I should see "Eigenaar"                                        # FeatureContext::assertPageContainsText()
    And I should see "14-07-1994"                                      # FeatureContext::assertPageContainsText()
    And I should see "Er is een e-mail verstuurd naar Jesse@jbdevv.nl" # FeatureContext::assertPageContainsText()



  [ErrorException]
  fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
  error:1409F07F:SSL routines:ssl3_write_pending:bad write retry

这就是错误发生的确切方式,我知道我应该看到姓氏,当我手动执行它时我可以看到姓氏,但不知何故它卡住了并且只是抛出了那个错误,如果我将删除该行 see jesse 它会在 see bessem 上成功并在下一个错误中显示错误,这将是电子邮件

最后经过更多挖掘

ErrorException in StreamBuffer.php line 232:
fwrite(): SSL: Broken pipe
in StreamBuffer.php line 232
at HandleExceptions->handleError('2', 'fwrite(): SSL: Broken pipe', '/home/vagrant/aag/code/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php', '232', array('bytes' => 'QUIT ', 'bytesToWrite' => '6', 'totalBytesWritten' => '0'))
at fwrite(resource, 'QUIT ') in StreamBuffer.php line 232

虽然我仍然不知道问题的根源,

尝试在 fwrite() 之前添加一个 sleep(5)。 之后它应该可以正常工作。

如果你想让它更高级一点,你可以尝试用 SSL_ERROR_WANT_WRITE 或 SSL_ERROR_WANT_READ 检查 SSL_Write 到 return,然后重复再次使用相同的参数调用 SSL_write。

好的,如果人们在开发环境中使用 behat 时会遇到类似的问题。 不要像我一样,不要使用 SMTP,而是在你的 .env 文件中使用日志作为 MAil_DRIVER,