Skip to content

Commit

Permalink
FAB-6091 Build with Go 1.9
Browse files Browse the repository at this point in the history
A prior change made fabric compatible
with G0 1.9.  This CR now builds fabric
with Go 1.9 by default by updating the
baseimage version to 0.4.1 which uses
Go 1.9.  Also updated any docs to
indicate Go 1.9 should now be used.

- Fixed linter error with sanitycheck.go
- added check for testing.tRunner for gossip
TestEndedGoroutines.  Not sure why I missed
this earlier

Change-Id: I213cc2f88363c32ccff246b5655afd88b42a7778
Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
  • Loading branch information
mastersingh24 committed Sep 11, 2017
1 parent 833b24a commit 453f4c3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .baseimage-release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.2
0.4.1
2 changes: 1 addition & 1 deletion common/tools/configtxlator/sanitycheck/sanitycheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

type Messages struct {
GeneralErrors []string `json:"general_errors"`
ElementWarnings []*ElementMessage `json:"element_errors"`
ElementWarnings []*ElementMessage `json:"element_warnings"`
ElementErrors []*ElementMessage `json:"element_errors"`
}

Expand Down
6 changes: 3 additions & 3 deletions docs/source/dev-setup/devenv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Prerequisites
~~~~~~~~~~~~~

- `Git client <https://git-scm.com/downloads>`__
- `Go <https://golang.org/>`__ - 1.7 or later (for releases before
v1.0, 1.6 or later)
- `Go <https://golang.org/>`__ - 1.9 or later (for v1.0.X releases, use
Go 1.7.X)
- For macOS,
`Xcode <https://itunes.apple.com/us/app/xcode/id497799835?mt=12>`__
must be installed
Expand All @@ -41,7 +41,7 @@ Prerequisites
brew install gnu-tar --with-default-names

- (only if using Vagrant) - `Vagrant <https://www.vagrantup.com/>`__ -
1.7.4 or later
1.9 or later
- (only if using Vagrant) -
`VirtualBox <https://www.virtualbox.org/>`__ - 5.0 or later
- BIOS Enabled Virtualization - Varies based on hardware
Expand Down
6 changes: 3 additions & 3 deletions docs/source/prereqs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ following command from a terminal prompt:
Go Programming Language
-----------------------

Hyperledger Fabric uses the Go programming language 1.7.x for many of its
Hyperledger Fabric uses the Go programming language 1.9.x for many of its
components.

.. note: Go version 1.8.x will yield test failures
.. note: building with Go version 1.8.x is not supported
- `Go <https://golang.org/>`__ - version 1.7.x
- `Go <https://golang.org/>`__ - version 1.9.x
Given that we are writing a Go chaincode program, we need to be sure that the
source code is located somewhere within the ``$GOPATH`` tree. First, you will
Expand Down
2 changes: 1 addition & 1 deletion examples/e2e_cli/end-to-end.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Prerequisites
- `Homebrew <https://brew.sh/>`__ - OSX only
- `Xcode <https://itunes.apple.com/us/app/xcode/id497799835?mt=12>`__ - OSX only (this can take upwards of an hour)
- `Docker Toolbox <https://docs.docker.com/toolbox/toolbox_install_windows/>`__ - Windows users only
- `Go <https://golang.org/>`__ - 1.7 or higher
- `Go <https://golang.org/>`__ - 1.9 or higher

On Windows machines you will also need the following which provides a better alternative to the Windows command prompt:

Expand Down
6 changes: 5 additions & 1 deletion gossip/gossip/gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,10 @@ var runTests = func(g goroutine) bool {
return searchInStackTrace("testing.RunTests", g.stack)
}

var tRunner = func(g goroutine) bool {
return searchInStackTrace("testing.tRunner", g.stack)
}

var waitForTestCompl = func(g goroutine) bool {
return searchInStackTrace("waitForTestCompletion", g.stack)
}
Expand Down Expand Up @@ -1318,7 +1322,7 @@ func anyOfPredicates(predicates ...goroutinePredicate) goroutinePredicate {

func shouldNotBeRunningAtEnd(gr goroutine) bool {
return !anyOfPredicates(runTests, goExit, testingg, waitForTestCompl, gossipTest,
clientConn, connectionLeak, connectionLeak2)(gr)
clientConn, connectionLeak, connectionLeak2, tRunner)(gr)
}

func ensureGoroutineExit(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions test/tools/PTE/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To build and test the following prerequisites must be installed first:
- node v7 is not currently supported
- gulp command
- `npm install -g gulp`
- go (v1.7 or later)
- go (v1.9 or later)
- refer to [Go - Getting Started](https://golang.org/doc/install)
- others:
- in Ubuntu: `apt install -y build-essential python libltdl-dev`
Expand Down Expand Up @@ -107,7 +107,7 @@ If you do not have access to a Fabric network, please see the section on [Creati
### Example
`./pte_driver.sh userInputs/runCases.txt`

`userInputs/runCases.txt` contains the list of user specified test cases to be executed. Each line is a test case and includes two parameters: **SDK type** and **user input file**.
`userInputs/runCases.txt` contains the list of user specified test cases to be executed. Each line is a test case and includes two parameters: **SDK type** and **user input file**.

For instance, a run cases file containing two test cases using the node SDK would be:
```
Expand Down Expand Up @@ -360,7 +360,7 @@ The output includes network id, thread id, transaction type, total transactions,
"fcn": "invoke",
"args": ["put", "a", "string-msg"]
}
},
},
"SCFile": [
{"ServiceCredentials":"SCFiles/config-local.json"}
]
Expand Down

0 comments on commit 453f4c3

Please sign in to comment.