~ubuntu-branches/ubuntu/trusty/mongodb/trusty-proposed

« back to all changes in this revision

Viewing changes to jstests/shellspawn.js

  • Committer: Bazaar Package Importer
  • Author(s): Antonin Kral
  • Date: 2010-01-29 19:48:45 UTC
  • Revision ID: james.westby@ubuntu.com-20100129194845-8wbmkf626fwcavc9
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
baseName = "jstests_shellspawn";
 
2
t = db.getCollection( baseName );
 
3
t.drop();
 
4
 
 
5
if ( typeof( _startMongoProgram ) == "undefined" ){
 
6
    print( "no fork support" );
 
7
}
 
8
else {
 
9
    spawn = startMongoProgramNoConnect( "mongo", "--port", myPort(), "--eval", "sleep( 2000 ); db.getCollection( \"" + baseName + "\" ).save( {a:1} );" );
 
10
    
 
11
    assert.soon( function() { return 1 == t.count(); } );
 
12
    
 
13
    stopMongoProgramByPid( spawn );
 
14
    
 
15
    spawn = startMongoProgramNoConnect( "mongo", "--port", myPort(), "--eval", "print( \"I am a shell\" );" );
 
16
    
 
17
    spawn = startMongoProgramNoConnect( "mongo", "--port", myPort() );
 
18
    
 
19
    spawn = startMongoProgramNoConnect( "mongo", "--port", myPort() );
 
20
    
 
21
    stopMongoProgramByPid( spawn );
 
22
    
 
23
    // all these shells should be killed
 
24
}
 
 
b'\\ No newline at end of file'