Commit Graph

82 Commits

Author SHA1 Message Date
Oleksandr Chekhovskyi
3d3c81830a Update node-mongodb driver to 2.2.16
This fixes an issue where the driver fails to recover from unresponsive
primary in a replica set.
2016-12-29 20:06:56 +01:00
Ben Newman
91058b53a7 Allow (junction) symlinking node_modules on Windows.
Hopefully fixes #7830 by ensuring that server node_modules are physically
present in the programs/server/npm directory.
2016-10-14 16:29:35 -04:00
Ben Newman
9039f98b30 Make findMongoPort return null if net.connect throws. 2016-10-14 16:24:27 -04:00
Ben Newman
ec34a4ecc6 Fix tests by making sure to close optimistic file watchers.
If a test process does not explicitly call process.exit, pathwatcher
watchers may keep it alive indefinitely (either that, or there's a bug
with the persistent:false option to fs.watchFile).

This accidental immortality can be prevented by explicitly closing all
watchers when we no longer have any interest in file change notifications.
2016-10-13 14:09:16 -04:00
Ben Newman
295d3d5678 Kill mongo when server process exits.
We try to kill any mongod processes before starting new ones, but this
change kills it when the development server shuts down, too.

Killing mongo on shutdown is particularly important for tests that run
meteor multiple times in a row, and for whatever reason fail to find and
kill running mongod processes on startup, e.g. because the --port has
changed (#7563).

This comment by @glasser seems to suggest this is a reasonable idea:
https://github.com/meteor/meteor/issues/2182#issuecomment-45685614

Fixes #2182 and possibly other related bugs.
2016-09-29 09:48:55 -04:00
Ben Newman
5b2e08a80c Automatically reconfigure Mongo replication set when --port differs.
Fixes #7563.
2016-09-29 09:48:55 -04:00
Yo-An Lin
e326fddafb Add option to skip release check (#7445)
* Add --no-release-check option to skip release check

* Add METEOR_NO_RELEASE_CHECK environment variable
2016-08-17 14:53:27 -04:00
Ben Newman
38096aafc8 Use --debug instead of --debug-brk for meteor debug.
Breaking on the first statement in the program used to be the only way to
get the debugger to stop at any breakpoints, but more recent versions of
node-inspector (compatible with Node 4) do a much better job of stopping
at breakpoints after the program starts.
2016-08-11 18:36:05 -04:00
Ben Newman
3c7f83778f Move server-side component of meteor shell into a package. (#7624)
This will make it much easier to fix bugs and make improvements going
forward, since they won't have to wait for the next release of Meteor.

One functional change: when the parent process exits, it no longer forces
all connected shell clients to disconnect, which is actually a more
convenient behavior, because it gives the clients a chance to reconnect
when/if the server starts up again, and it's easy enough to kill the
clients if that's what you want.
2016-08-11 09:11:40 -04:00
Tom Coleman
57dfb0b4e1 Don't try and use wired tiger on 32bit linux
For https://github.com/meteor/meteor/issues/7511
2016-07-29 13:19:14 +10:00
Ben Newman
81986f1894 Don't call nonexistent writeHead method of net.Socket objects. 2016-06-27 10:02:37 -04:00
Fabricio Nascimento
0c5e19bf70 Removing error handling no longer needed 2016-06-24 12:15:29 -04:00
Fabricio Nascimento
711c50291c Improves on error handling during replicaSet setup 2016-06-24 12:15:28 -04:00
Fabricio Nascimento
4a5d4b7d68 Fix initializing and running mongod 2016-06-24 12:15:27 -04:00
Tom Coleman
bcfe072d52 Turn off journal for wired tiger in development 2016-06-24 12:15:27 -04:00
Tom Coleman
49d7afabca Added a warning when running the tool against a mmapv1 database 2016-06-24 12:15:27 -04:00
Ben Newman
381064e4bb Run mongod with mmapv1 instead of wiredTiger on Windows. 2016-06-24 12:15:27 -04:00
Tom Coleman
6273e74ff6 Updated run-mongo code for 3.2 messages 2016-06-24 12:15:25 -04:00
Ben Newman
08f074d2fe Cope with asynchronous ChildProcess.prototype.send in Node v4.
https://github.com/nodejs/node/pull/2620

Part of #6921.
2016-06-24 12:15:08 -04:00
Ben Newman
b83e4d3061 Avoid crashing when proxying invalid requests. 2016-06-20 18:31:13 -04:00
Jonas Aschenbrenner
d2309542a2 Removes Velocity testing code 2016-06-16 19:13:25 +02:00
Ben Newman
dce2b20ddb Merge pull request #7033 from meteor/release-1.3.3
Release 1.3.3
2016-06-10 18:18:28 -04:00
chemicstry
512799ed9e Initial IPv6 support 2016-06-06 02:17:36 +03:00
Ben Newman
bae5983d59 Merge branch 'devel' into release-1.3.3 2016-05-27 00:02:48 -04:00
Tom Coleman
ab85045f58 Don't allow logs to yield to avoid missing logs when the app quits 2016-05-25 18:23:28 -07:00
Tom Coleman
cd0b47e567 Only isopacket.load the logging package once
This was causing yielding problems leading to log ordering issues
2016-05-25 14:15:55 -07:00
Ben Newman
6e1346a74b Remove phantomjs-prebuilt from the dev bundle.
Saves 50MB from the extracted size of the dev_bundle/lib/node_modules
directory, previously 262MB. The entire dev bundle is 332MB extracted, for
perspective.

More importantly, since the `phantomjs` binary is not very compressible,
this change reduces the *compressed* size of the dev bundle from 71MB to
54MB, a 24% savings.

Closes #6905.
2016-05-17 11:50:48 -04:00
Ben Newman
727624a2f7 Bump dev bundle package versions to work with newer Node versions. 2016-05-16 18:21:11 -04:00
Ben Newman
d94e7d812d Upgrade dev bundle meteor-promise to 0.7.1. 2016-05-16 18:21:11 -04:00
Martijn Walraven
0486b473e8 Make some more self tests pass 2016-03-18 20:40:57 +01:00
Martijn Walraven
8ea1e27656 Log client restart before restarting client to get self tests passing 2016-03-18 20:40:56 +01:00
Martijn Walraven
0714048b34 Revert "Improve Runner.start logic"
This reverts commit 1032f271e9.
2016-03-17 22:33:56 +01:00
Ben Newman
1a1f8327c6 Avoid depainting console messages after server restarts.
Fixes #6226.
2016-03-14 17:07:17 -04:00
Tom Coleman
96c802edb4 Correct behavior for setting buildMode/NODE_ENV 2016-03-14 11:18:23 +11:00
Ben Newman
730e713592 Allow values other than "development" and "production" for $NODE_ENV. 2016-03-11 21:30:19 -05:00
Tom Coleman
50540e5e28 Merge branch 'aldeed-pr' into release-1.3 2016-03-12 10:55:20 +11:00
Eric Dobbertin
1032f271e9 Improve Runner.start logic
No visible changes
2016-03-11 15:09:41 +11:00
Tom Coleman
2c617225cd Ensure that runAll always sets NODE_ENV+buildMode sensibly.
Note there are a few use cases I can think of we want to worry about:

`meteor run` -- both should be "development"
`meteor run --production` - both should be "production"
`NODE_ENV=production meteor run` - as above
`NODE_ENV=development meteor run --production` - `--production` should win
`meteor test` - NODE_ENV should be "development", buildMode should be "test"
`NODE_ENV=production meteor test" - NODE_ENV should be "production", buildMode should be "test"
2016-03-11 12:29:36 +11:00
Tom Coleman
b6c2ecf5fc A couple of small typos 2016-03-10 09:37:11 +11:00
Tom Coleman
27faeefb31 Pass test metadata in via an environment variable.
[Only works on the server right now, fairly uselessly]

For #6331
2016-03-09 15:30:45 +11:00
Ben Newman
40857bdaff Propagate meteorEnv subset of process.env from server to client.
Fixes #6399.
2016-03-08 19:37:57 -05:00
Tom Coleman
7f4d9706b8 Make meteor run --once not quiet. #6359 2016-03-03 12:10:59 +11:00
Avital Oliver
a335875e19 Merge remote-tracking branch 'origin/release-1.3' into app-tests 2016-02-05 14:57:44 -08:00
David Greenspan
e50b182772 Avoid infinitely re-running the app on error
Bump up the crashCount reset delay from 3 seconds to 8 seconds.

If the delay is smaller than app start-up time, then an app that
crashes at start-up will be treated as an app that crashed while
running and will be automatically restarted, and this will lead to
an infinite loop of restarting.  Making the delay longer just increases
the time right after app start where a crash counts towards the max of
three restarts in a row.  For example, if we upped the delay to 60
seconds, then an app that crashed in its first minute would restart but
gain a crashCount of 1, and if there were two more crashes within the
first minute of running (without another crash *not* within the first
minute to reset the counter), the app would fail to automatically
restart.

This whole mechanism is a little janky and was written way way back.
The number 3 was previously 2, but app start-up got a little bit slower.
Hopefully the number 8 will last us until this code is replaced.
2016-02-05 01:18:17 -08:00
David Greenspan
fabb20d2cd Rebuild in place for better performance
writeSiteArchive already supported rebuilding in place (rather than
creating a new build directory and moving it into place; see comments
at top of builder.js), but it was not used and didn't work:

* run-app.js only passed previousBuilders to the bundler in the case
  of a client-only refresh, in which case it also passed
  hasCachedBundle, bypassing writeSiteArchive altogether.

* writeSiteArchive's use of previousBuilders seemingly didn't work,
  because the site archive itself was never written in place, so
  trying to write the targets "in place" into a brand-new build
  directory didn't make sense (and threw an error).

With this change, previousBuilders are kept across all rebuilds
(not just client-only refreshes), which enables efficient, in-place
building (except on Windows, where in-place building has never been
supported), and writeSiteArchive is fixed to write the site archive
in place as well.
2016-02-04 17:11:39 -08:00
David Greenspan
2fca3a9599 Profile more of tool and improvements to Profile
Previously, we would generate reports on
"Selecting Package Versions" and "Rebuild App".

- Instead of just profiling constraint solving, profile the entire
  process of preparing the project via ProjectContext, by giving
  each public function that "advances the stage" a Profile.run
  (typically prepareProjectForBuild).
- Improve profiler output to better distinguish multiple runs
- Distinguish "Build App" and "Rebuild App"
- Instrument lots of calls that weren't instrumented before
2016-02-03 11:54:05 -08:00
Avital Oliver
ac5a4bc809 WIP: Implement a meteor test-app command.
This command builds the app with a different directory for
`.meteor/local`, including built packages and the app database. This
allows running `meteor test-app` and `meteor test` in parallel
for a given app, with DB isolation.

Also, we've changed how test driver packages work (as used for
`meteor test-packages`, like "test-in-browser"). Instead of automatically
running tests when they load, they export a `runTests` function that
you should call when you're ready to run tests.

When running `meteor test-app` or `meteor test-packages` a new additional
last line of code is added that calls `Meteor.startup(...runTests()...)`

TODO:
* Implement `testOnly` packages. The current pattern of reading a global
  from `package.js` won't work for published packages, which are stored
  as metadata, not code.
* Let you choose a test driver package as an argument to `meteor test-app`
* Demonstrate that a Mocha test and driver package are possible to write.
* Expose Meteor.isTest, Meteor.isIntegrationTest, Meteor.isUnitTest
* Implement `meteor test-app --unit` which only loads test files
* `meteor test-app` should load ALL *.tests?.* files, including ones
  inside imports/ directories
2016-01-22 15:18:10 -08:00
Ben Newman
3cafbc72ac Use async functions to eliminate the need for fiberHelpers.inBareFiber.
The comments for inBareFiber claim that it's for times when you don't want
to inherit the dynamic environment variables of the current Fiber, but
none of the call sites actually relied on this behavior. Still, it may be
worth noting that async functions automatically (and cheaply) inherit the
calling Fiber's dynamics, which is virtually always what you want.
2015-12-09 12:06:51 -05:00
Ben Newman
58fcc8d49e Use an async method to start Mongo in a Fiber. 2015-12-09 12:06:51 -05:00
Ben Newman
9a466d2efa Eliminate Future from tools/run-mongo.js. 2015-12-09 12:06:50 -05:00