fix #17325 linux 32bit CI; fix #17085 flaky test (#17469)

This commit is contained in:
Timothee Cour 2021-03-24 02:36:15 -07:00 • committed by GitHub
commit e94aec20da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 10 deletions

View file

@ -17,11 +17,11 @@ jobs:
Linux_amd64: Linux_amd64:
vmImage: 'ubuntu-16.04' vmImage: 'ubuntu-16.04'
CPU: amd64 CPU: amd64
# Linux_i386: Linux_i386:
# # bug #17325: fails on 'ubuntu-16.04' because it now errors with: # bug #17325: fails on 'ubuntu-16.04' because it now errors with:
# # g++-multilib : Depends: gcc-multilib (>= 4:5.3.1-1ubuntu1) but it is not going to be installed # g++-multilib : Depends: gcc-multilib (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
# vmImage: 'ubuntu-18.04' vmImage: 'ubuntu-18.04'
# CPU: i386 CPU: i386
OSX_amd64: OSX_amd64:
vmImage: 'macOS-10.15' vmImage: 'macOS-10.15'
CPU: amd64 CPU: amd64

View file

@ -1075,12 +1075,13 @@ when defined(nimFixedForwardGeneric):
dst = jsonNode.copy dst = jsonNode.copy
proc initFromJson[T: SomeInteger](dst: var T; jsonNode: JsonNode, jsonPath: var string) = proc initFromJson[T: SomeInteger](dst: var T; jsonNode: JsonNode, jsonPath: var string) =
when T is uint|uint64: when T is uint|uint64 or (not defined(js) and int.sizeof == 4):
verifyJsonKind(jsonNode, {JInt, JString}, jsonPath)
case jsonNode.kind case jsonNode.kind
of JString: of JString:
dst = T(parseBiggestUInt(jsonNode.str)) let x = parseBiggestUInt(jsonNode.str)
dst = cast[T](x)
else: else:
verifyJsonKind(jsonNode, {JInt}, jsonPath)
dst = T(jsonNode.num) dst = T(jsonNode.num)
else: else:
verifyJsonKind(jsonNode, {JInt}, jsonPath) verifyJsonKind(jsonNode, {JInt}, jsonPath)

View file

@ -1,11 +1,20 @@
discard """ discard """
output: '''10000000 output: '''
10000000
10000000 10000000
10000000''' 10000000'''
""" """
# bug #17085 # bug #17085
#[
refs https://github.com/nim-lang/Nim/issues/17085#issuecomment-786466595
with --gc:boehm, this warning sometimes gets generated:
Warning: Repeated allocation of very large block (appr. size 14880768):
May lead to memory leak and poor performance.
nim CI now runs this test with `testWithoutBoehm` to avoid running it with --gc:boehm.
]#
proc init(): string = proc init(): string =
for a in 0..<10000000: for a in 0..<10000000:
result.add 'c' result.add 'c'
@ -16,6 +25,8 @@ proc f() =
var c {.global.} = init() var c {.global.} = init()
echo a.len echo a.len
# `echo` intentional according to
# https://github.com/nim-lang/Nim/pull/17469/files/0c9e94cb6b9ebca9da7cb19a063fba7aa409748e#r600016573
echo b.len echo b.len
echo c.len echo c.len

View file

@ -71,7 +71,7 @@ template fn() =
block: block:
let a = (int32.high, uint32.high) let a = (int32.high, uint32.high)
testRoundtrip(a): "[2147483647,4294967295]" testRoundtrip(a): "[2147483647,4294967295]"
when not defined(js): when int.sizeof > 4:
block: block:
let a = (int64.high, uint64.high) let a = (int64.high, uint64.high)
testRoundtrip(a): "[9223372036854775807,18446744073709551615]" testRoundtrip(a): "[9223372036854775807,18446744073709551615]"