-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Jameswtruher/travisdailybuild #2958
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
Changes from all commits
3ff1bea
a63a928
ae15e5f
d495bf8
1f26d3b
53d3e8e
4be7f19
750ba21
da6f88f
99112fd
218415a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,18 +24,56 @@ function Get-RuntimeError | |
| [CmdletBinding()] | ||
| param( | ||
| [Parameter(ValueFromPipeline=$True,Mandatory=$True)] | ||
| [string]$src | ||
| [string]$src, | ||
| [Parameter()] | ||
| [int]$Timeout = 0 | ||
| ) | ||
|
|
||
| $errors = $null | ||
| try | ||
| { | ||
| [scriptblock]::Create($src).Invoke() > $null | ||
| # some tests cannot be run in a isolated runspace | ||
| # easily because they require more than just a single | ||
| # execution | ||
| if ( $Timeout -eq 0 ) | ||
| { | ||
| [scriptblock]::Create($src).Invoke() > $null | ||
| } | ||
| else | ||
| { | ||
| $ps = [powershell]::Create() | ||
| $ps.AddScript($src) > $null | ||
| $ar = $ps.BeginInvoke() | ||
| # give it 250 milliseconds to complete | ||
| start-sleep -mill 250 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parser tests is very fast (some ms). This change will slow them down in many times.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, it will slow down some tests, but I reckoned that it was better to slow down the test than to invalidate an entire run - that's what I'm trying to avoid. When running a full test pass I saw nearly 100% test runs killed for lack of activity. Each one of those runs were hung in the language tests. In reply to: 94967709 [](ancestors = 94967709)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am concerned that we conceal the problem. Is there a way to reproduce this problem except to get a hung accidentally? I believe that we in the allowed time could identify the problem and fix it by analyzing a dump without slow down tests. #WontFix
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. while I agree that we need to determine root cause, i disagree about where. Catching this in CI has been extremely difficult and collecting dumps in Travis is really something I would rather avoid (if it's even possible). In reply to: 94993680 [](ancestors = 94993680)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be an issue that needs investigation. Please open an issue for this. #Resolved
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| if ( $ar.IsCompleted ) { | ||
| $ps.EndInvoke($ar) | ||
| } | ||
| # wait another ${Timeout} seconds, then give up | ||
| else { | ||
| Start-Sleep -sec $Timeout | ||
| if ( $ar.IsCompleted ) { | ||
| # this can throw, which will be picked up below | ||
| $ps.EndInvoke($ar) | ||
| } | ||
| else { | ||
| # if it didn't throw, then return a constructed error | ||
| $ER = Write-Error "Operation Timed Out ('$src')" 2>&1 | ||
| return $ER | ||
| } | ||
| } | ||
| } | ||
| } | ||
| catch | ||
| { | ||
| return $_.Exception.InnerException.ErrorRecord | ||
| } | ||
| finally | ||
| { | ||
| if ( $ps -ne $null ) { | ||
| $ps.dispose() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| function position_message | ||
|
|
@@ -76,7 +114,7 @@ function ShouldBeParseError | |
| if ($SkipAndCheckRuntimeError) | ||
| { | ||
| It "error should happen at parse time, not at runtime" -Skip {} | ||
| $errors = Get-RuntimeError -Src $src | ||
| $errors = Get-RuntimeError -Src $src -Timeout 10 | ||
| # for runtime errors we will only get the first one | ||
| $expectedErrors = ,$expectedErrors[0] | ||
| $expectedOffsets = ,$expectedOffsets[0] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to reset this back to previous setting when we complete the script? #ByDesign
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope - test tests are executed in a new scope, so it gets set back when the script exits #Closed