Skip to content

Web Cmdlets test intermittently fail with WebListener timeout #6001

Description

I've seen this a few times.

Steps to reproduce

Run Windows CI Tests

Expected behavior

No failures

Actual behavior

https://ci.appveyor.com/project/PowerShell/powershell/build/6.0.0-7706#L2212

Describing Web cmdlets tests using the cmdlet's aliases
 [-] Error occurred in Describe block 15.39s
   WebListener did not start before the timeout was reached.
   At C:\projects\powershell\test\tools\Modules\WebListener\WebListener.psm1:91 char:13
Describing Write-Debug tests
+

Environment data

> $PSVersionTable
in 6.0.1 branch

Activity

  1. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator
  2. markekraus commented on Jan 24, 2018

    @markekraus
    Contributor

    I have seen this before a few times, but I can never reproduce it when I try. The only way I see we can get to the bottom if it is to add super verbose failure messages and then reviewing the output when it does fail.

  3. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    Maybe CI very slow and we should wait more? What is timeout for the start?

  4. markekraus commented on Jan 24, 2018

    @markekraus
    Contributor

    15 seconds

  5. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    We could increase the timeout and get anything useful to $initStatus.

  6. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    Also we check a real time with Get-Date. But if VM sleeps long time the real time loses a value. I think it is more reliably count 100ms intervals in the cycle.

  7. markekraus commented on Jan 24, 2018

    @markekraus
    Contributor

    But if VM sleeps long time the real time loses a value.

    what?

  8. markekraus commented on Jan 24, 2018

    @markekraus
    Contributor

    as for $initstatus.. $Job | Stop-Job -PassThru | Receive-Job should b dumping anything that would be in it in the catch block.

  9. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    But if VM sleeps long time the real time loses a value.
    what?

    We get $timeOut = (get-date).AddSeconds($initTimeoutSeconds). Then VM sleeps 30 seconds. Then it run and we check (get-date) -lt $timeOut) - we already expire although we worked only 100 ms!

  10. markekraus commented on Jan 24, 2018

    @markekraus
    Contributor

    Then VM sleep 30 seconds.

    what?

  11. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    I mean, CI farm can be very busy and VM can be put in a pause.

  12. markekraus commented on Jan 24, 2018

    @markekraus
    Contributor

    so something like

    $sleepMilliseconds = 100
    $sleepCount = $initTimeoutSeconds * 1000 / $sleepMilliseconds
    do {
        Start-Sleep -Milliseconds $sleepMilliseconds
        $initStatus = $Job.ChildJobs[0].Output | Out-String
        $isRunning = $initStatus -match $initCompleteMessage
        $sleepCount--
    }
    while (-not $isRunning -and $sleepCount -gt 0)
  13. iSazonov commented on Jan 24, 2018

    @iSazonov
    Collaborator

    Yes. If CI VM really slow-slow this help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions