Re: [go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-03-05 Thread andrey mirtchovski
Thanks. This will give me a chance to check the new GitHub PR process:
https://github.com/golang/go/pull/24255

On Mon, Mar 5, 2018 at 11:40 AM, Ian Lance Taylor  wrote:
> On Mon, Mar 5, 2018 at 10:10 AM, andrey mirtchovski
>  wrote:
>>
>> I finally found some time to work on this and I think I figured out
>> why it fails. I run a very large history file (my HISTSIZE is set to
>> 10) and on this particular machine I'm at the limit. This causes
>> the os/signal test to run an average 6-7 seconds. The test timeout as
>> shown in my second email seems to be 5 seconds.
>>
>> The easiest way I could find to disable history loading in the bash
>> shell is to set HISTFILE=/dev/null. This reduces the test duration to
>> ~0.2 seconds from ~1.9 seconds. This is sufficient to pass the test:
>>
>> 8<
>> $ go test -run TestTerminalSignal # original
>> PASS
>> ok  os/signal 1.923s
>> $ vi signal_cgo_test.go
>> $ go test -run TestTerminalSignal # with HISTFILE=/dev/null
>> PASS
>> ok  os/signal 0.136s
>> $ git diff .
>> diff --git a/src/os/signal/signal_cgo_test.go 
>> b/src/os/signal/signal_cgo_test.go
>> index 84a2a08ce9..c1cedc7910 100644
>> --- a/src/os/signal/signal_cgo_test.go
>> +++ b/src/os/signal/signal_cgo_test.go
>> @@ -89,6 +89,7 @@ func TestTerminalSignal(t *testing.T) {
>> ctx, cancel := context.WithTimeout(context.Background(), 
>> 10*time.Second)
>> defer cancel()
>> cmd := exec.CommandContext(ctx, bash, "--norc", "--noprofile", "-i")
>> +   cmd.Env = append(os.Environ(), "HISTFILE=/dev/null")
>> cmd.Stdin = slave
>> cmd.Stdout = slave
>> cmd.Stderr = slave
>> 8<
>>
>> If this is an acceptable solution I can prepare a PR on GitHub.
>
> Thanks for figuring this out.  It seems very strange to me that a
> history file could cause the test to take more than 5 seconds.  That
> said, setting HISTFILE is probably a good idea anyhow.  I think it
> should work to set it to the empty string, which would be slightly
> better than /dev/null.  Thanks.
>
> Ian
>
>
>> On Tue, Feb 6, 2018 at 4:20 PM, Ian Lance Taylor  wrote:
>>> On Tue, Feb 6, 2018 at 2:54 PM, andrey mirtchovski
>>>  wrote:
 $ go test -c os/signal
 $ ./signal.test
 PASS
 $ go tool dist test -v

 # Testing packages.
 # go tool dist test -run=^go_test:archive/tar$
 [...]
 ok  net/url (cached)
 ok  os 0.677s
 ok  os/exec 1.414s
 --- FAIL: TestTerminalSignal (5.01s)
 signal_cgo_test.go:138: "PS1='prompt> '\r\n"
 signal_cgo_test.go:163: timed out waiting for shell prompt
 FAIL
 FAIL os/signal 10.104s
 ok  os/user (cached)
 [...]

 At which point I interrupted it. I blew up the entire go repo at and
 cloned it again at tip. This persists.

 $ go version
 go version devel +23e8e197b0 Tue Feb 6 18:24:33 2018 + darwin/amd64
>>>
>>> I'm sorry, I have no idea, and nobody else has reported this.  We
>>> could just disable the test, but it would be nice to see at least one
>>> more report before doing that.
>>>
>>> Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-03-05 Thread Ian Lance Taylor
On Mon, Mar 5, 2018 at 10:10 AM, andrey mirtchovski
 wrote:
>
> I finally found some time to work on this and I think I figured out
> why it fails. I run a very large history file (my HISTSIZE is set to
> 10) and on this particular machine I'm at the limit. This causes
> the os/signal test to run an average 6-7 seconds. The test timeout as
> shown in my second email seems to be 5 seconds.
>
> The easiest way I could find to disable history loading in the bash
> shell is to set HISTFILE=/dev/null. This reduces the test duration to
> ~0.2 seconds from ~1.9 seconds. This is sufficient to pass the test:
>
> 8<
> $ go test -run TestTerminalSignal # original
> PASS
> ok  os/signal 1.923s
> $ vi signal_cgo_test.go
> $ go test -run TestTerminalSignal # with HISTFILE=/dev/null
> PASS
> ok  os/signal 0.136s
> $ git diff .
> diff --git a/src/os/signal/signal_cgo_test.go 
> b/src/os/signal/signal_cgo_test.go
> index 84a2a08ce9..c1cedc7910 100644
> --- a/src/os/signal/signal_cgo_test.go
> +++ b/src/os/signal/signal_cgo_test.go
> @@ -89,6 +89,7 @@ func TestTerminalSignal(t *testing.T) {
> ctx, cancel := context.WithTimeout(context.Background(), 
> 10*time.Second)
> defer cancel()
> cmd := exec.CommandContext(ctx, bash, "--norc", "--noprofile", "-i")
> +   cmd.Env = append(os.Environ(), "HISTFILE=/dev/null")
> cmd.Stdin = slave
> cmd.Stdout = slave
> cmd.Stderr = slave
> 8<
>
> If this is an acceptable solution I can prepare a PR on GitHub.

Thanks for figuring this out.  It seems very strange to me that a
history file could cause the test to take more than 5 seconds.  That
said, setting HISTFILE is probably a good idea anyhow.  I think it
should work to set it to the empty string, which would be slightly
better than /dev/null.  Thanks.

Ian


> On Tue, Feb 6, 2018 at 4:20 PM, Ian Lance Taylor  wrote:
>> On Tue, Feb 6, 2018 at 2:54 PM, andrey mirtchovski
>>  wrote:
>>> $ go test -c os/signal
>>> $ ./signal.test
>>> PASS
>>> $ go tool dist test -v
>>>
>>> # Testing packages.
>>> # go tool dist test -run=^go_test:archive/tar$
>>> [...]
>>> ok  net/url (cached)
>>> ok  os 0.677s
>>> ok  os/exec 1.414s
>>> --- FAIL: TestTerminalSignal (5.01s)
>>> signal_cgo_test.go:138: "PS1='prompt> '\r\n"
>>> signal_cgo_test.go:163: timed out waiting for shell prompt
>>> FAIL
>>> FAIL os/signal 10.104s
>>> ok  os/user (cached)
>>> [...]
>>>
>>> At which point I interrupted it. I blew up the entire go repo at and
>>> cloned it again at tip. This persists.
>>>
>>> $ go version
>>> go version devel +23e8e197b0 Tue Feb 6 18:24:33 2018 + darwin/amd64
>>
>> I'm sorry, I have no idea, and nobody else has reported this.  We
>> could just disable the test, but it would be nice to see at least one
>> more report before doing that.
>>
>> Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-03-05 Thread andrey mirtchovski
Hi,

I finally found some time to work on this and I think I figured out
why it fails. I run a very large history file (my HISTSIZE is set to
10) and on this particular machine I'm at the limit. This causes
the os/signal test to run an average 6-7 seconds. The test timeout as
shown in my second email seems to be 5 seconds.

The easiest way I could find to disable history loading in the bash
shell is to set HISTFILE=/dev/null. This reduces the test duration to
~0.2 seconds from ~1.9 seconds. This is sufficient to pass the test:

8<
$ go test -run TestTerminalSignal # original
PASS
ok  os/signal 1.923s
$ vi signal_cgo_test.go
$ go test -run TestTerminalSignal # with HISTFILE=/dev/null
PASS
ok  os/signal 0.136s
$ git diff .
diff --git a/src/os/signal/signal_cgo_test.go b/src/os/signal/signal_cgo_test.go
index 84a2a08ce9..c1cedc7910 100644
--- a/src/os/signal/signal_cgo_test.go
+++ b/src/os/signal/signal_cgo_test.go
@@ -89,6 +89,7 @@ func TestTerminalSignal(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, bash, "--norc", "--noprofile", "-i")
+   cmd.Env = append(os.Environ(), "HISTFILE=/dev/null")
cmd.Stdin = slave
cmd.Stdout = slave
cmd.Stderr = slave
8<

If this is an acceptable solution I can prepare a PR on GitHub.


On Tue, Feb 6, 2018 at 4:20 PM, Ian Lance Taylor  wrote:
> On Tue, Feb 6, 2018 at 2:54 PM, andrey mirtchovski
>  wrote:
>> $ go test -c os/signal
>> $ ./signal.test
>> PASS
>> $ go tool dist test -v
>>
>> # Testing packages.
>> # go tool dist test -run=^go_test:archive/tar$
>> [...]
>> ok  net/url (cached)
>> ok  os 0.677s
>> ok  os/exec 1.414s
>> --- FAIL: TestTerminalSignal (5.01s)
>> signal_cgo_test.go:138: "PS1='prompt> '\r\n"
>> signal_cgo_test.go:163: timed out waiting for shell prompt
>> FAIL
>> FAIL os/signal 10.104s
>> ok  os/user (cached)
>> [...]
>>
>> At which point I interrupted it. I blew up the entire go repo at and
>> cloned it again at tip. This persists.
>>
>> $ go version
>> go version devel +23e8e197b0 Tue Feb 6 18:24:33 2018 + darwin/amd64
>
> I'm sorry, I have no idea, and nobody else has reported this.  We
> could just disable the test, but it would be nice to see at least one
> more report before doing that.
>
> Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-02-06 Thread Ian Lance Taylor
On Tue, Feb 6, 2018 at 2:54 PM, andrey mirtchovski
 wrote:
> $ go test -c os/signal
> $ ./signal.test
> PASS
> $ go tool dist test -v
>
> # Testing packages.
> # go tool dist test -run=^go_test:archive/tar$
> [...]
> ok  net/url (cached)
> ok  os 0.677s
> ok  os/exec 1.414s
> --- FAIL: TestTerminalSignal (5.01s)
> signal_cgo_test.go:138: "PS1='prompt> '\r\n"
> signal_cgo_test.go:163: timed out waiting for shell prompt
> FAIL
> FAIL os/signal 10.104s
> ok  os/user (cached)
> [...]
>
> At which point I interrupted it. I blew up the entire go repo at and
> cloned it again at tip. This persists.
>
> $ go version
> go version devel +23e8e197b0 Tue Feb 6 18:24:33 2018 + darwin/amd64

I'm sorry, I have no idea, and nobody else has reported this.  We
could just disable the test, but it would be nice to see at least one
more report before doing that.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-02-06 Thread andrey mirtchovski
$ go test -c os/signal
$ ./signal.test
PASS
$ go tool dist test -v

# Testing packages.
# go tool dist test -run=^go_test:archive/tar$
[...]
ok  net/url (cached)
ok  os 0.677s
ok  os/exec 1.414s
--- FAIL: TestTerminalSignal (5.01s)
signal_cgo_test.go:138: "PS1='prompt> '\r\n"
signal_cgo_test.go:163: timed out waiting for shell prompt
FAIL
FAIL os/signal 10.104s
ok  os/user (cached)
[...]

At which point I interrupted it. I blew up the entire go repo at and
cloned it again at tip. This persists.

$ go version
go version devel +23e8e197b0 Tue Feb 6 18:24:33 2018 + darwin/amd64

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-02-06 Thread andrey mirtchovski
I'm trying to understand why os/signal tests fail on my 10.12 macbook
pro at tip:

$ ./all.bash
[...]
ok  net/textproto (cached)
ok  net/url (cached)
ok  os 0.678s
ok  os/exec 1.185s
--- FAIL: TestTerminalSignal (5.01s)
signal_cgo_test.go:138: "PS1='prompt> '\r\n"
signal_cgo_test.go:163: timed out waiting for shell prompt
FAIL
FAIL os/signal 9.920s
ok  os/user (cached)
[...]

If I run 'go tool dist test -v' the test will fail again:
$ go tool dist test -v

# Testing packages.
# go tool dist test -run=^go_test:archive/tar$
[...]
ok  net/url (cached)
ok  os 0.722s
ok  os/exec 1.596s
--- FAIL: TestTerminalSignal (5.01s)
signal_cgo_test.go:138: "PS1='prompt> '\r\n"
signal_cgo_test.go:163: timed out waiting for shell prompt
FAIL
FAIL os/signal 9.770s



however if I run the following the test passes and is now cached:

$ go tool dist test -v -run=^go_test:os/signal$

# Testing packages.
# go tool dist test -run=^go_test:os/signal$
ok  os/signal 6.468s

ALL TESTS PASSED (some were excluded)
$

and now 'go tool dist test -v'

$ go tool dist test -v

# Testing packages.
# go tool dist test -run=^go_test:archive/tar$
[...]
ok  net/url (cached)
ok  os (cached)
ok  os/exec (cached)
ok  os/signal (cached)
ok  os/user (cached)
[...]
$

this lasts until the next all.bash invocation.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.