tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

testing: implement -timeout flag

Open eliasnaur opened this issue 4 months ago • 11 comments

Note that this PR renames the existing -timeout flag to -vol-timeout.

Should reduce the multi-hour hangs on macOS builders (#4995) to ~10 minutes.

eliasnaur avatar Aug 25 '25 07:08 eliasnaur

Note that this PR renames the existing -timeout flag to -vol-timeout.

Is that a problem for anyone?

Should reduce the multi-hour hangs on macOS builders (#4995) to ~10 minutes.

Yes please! :smile_cat:

deadprogram avatar Sep 12 '25 12:09 deadprogram

Just wondering do we actually need to rename the flag? Do your other changes actually require that, @eliasnaur?

deadprogram avatar Sep 13 '25 11:09 deadprogram

Just wondering do we actually need to rename the flag? Do your other changes actually require that, @eliasnaur?

I'm not sure I understand your question. Are you suggesting to keep -timeout for volume timeouts, or to overload its meaning to depend on whether you're running tinygo flash or tinygo test?

eliasnaur avatar Sep 13 '25 11:09 eliasnaur

overload its meaning to depend on whether you're running tinygo flash or tinygo test

I think that is what I meant.

deadprogram avatar Sep 13 '25 11:09 deadprogram

overload its meaning to depend on whether you're running tinygo flash or tinygo test

I think that is what I meant.

It's possible, but I don't think it's worth the confusion. Besides, "timeout" is not a great name for something as specific as "the length of time to retry locating the MSD volume to be used for flashing".

eliasnaur avatar Sep 13 '25 11:09 eliasnaur

Fair point. In that case, how about renaming it to flash-timeout?

deadprogram avatar Sep 13 '25 11:09 deadprogram

Fair point. In that case, how about renaming it to flash-timeout?

The timeout is for waiting for the flash volume, not flashing in itself. For example, if you're flashing through a debugger -flash-timeout would be ignored.

How about -volume-timeout?

eliasnaur avatar Sep 13 '25 11:09 eliasnaur

Sounds good to me!

deadprogram avatar Sep 13 '25 12:09 deadprogram

@eliasnaur can you please rebase this branch against the latest dev? Not sure why the CI is failing.

deadprogram avatar Sep 14 '25 10:09 deadprogram

I already did, and I'm not sure either.

For some reason, my Linux VM fails to run make tinygo-test with the following error:

$ nix develop
$ go install
$ make tinygo-test
/home/e/go/bin/tinygo test -skip='TestExtraMethods|TestParseAndBytesRoundTrip/P256/Generic' cmp compress/lzw compress/zlib container/heap container/list container/ring crypto/ecdsa crypto/elliptic crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 database/sql/driver debug/macho embed/internal/embedtest encoding encoding/ascii85 encoding/asn1 encoding/base32 encoding/base64 encoding/csv encoding/hex go/ast go/format go/scanner go/version hash hash/adler32 hash/crc64 hash/fnv html internal/itoa internal/profile math math/cmplx net/http/internal/ascii net/mail os path reflect sync testing testing/iotest text/scanner unicode unicode/utf16 unicode/utf8 unique  archive/zip compress/flate crypto/aes crypto/des crypto/hmac debug/dwarf debug/plan9obj image io/ioutil mime mime/multipart mime/quotedprintable net net/mail net/textproto os/user regexp/syntax strconv text/tabwriter text/template/parse compress/bzip2 crypto/dsa index/suffixarray 
package net/http/internal/ascii is not in std (/home/e/.cache/tinygo/goroot-d6ba3aaea39ea12a38e3f8b292ba2e412e6bfc30c3b3b8a879b97c4a782dc8a2/src/net/http/internal/ascii)
../../.cache/tinygo/goroot-d6ba3aaea39ea12a38e3f8b292ba2e412e6bfc30c3b3b8a879b97c4a782dc8a2/src/net/mail/message.go:27:2: package net is not in std (/home/e/.cache/tinygo/goroot-d6ba3aaea39ea12a38e3f8b292ba2e412e6bfc30c3b3b8a879b97c4a782dc8a2/src/net)
cannot resolve packages: exit status 1
make: *** [GNUmakefile:491: tinygo-test] Error 1

eliasnaur avatar Sep 14 '25 11:09 eliasnaur

@eliasnaur see #5080 for a different fix for the test race, although not for the root cause itself.

deadprogram avatar Nov 06 '25 16:11 deadprogram